![]() |
OpenCV 4.12.0
开源计算机视觉
|
用于按需读取多页图像。更多...
#include <opencv2/imgcodecs.hpp>
类 | |
| 结构体 | 迭代器 |
公共成员函数 | |
| ImageCollection () | |
| ImageCollection (const String &filename, int flags) | |
| const Mat & | at (int index) |
| iterator | begin () |
| iterator | end () |
| Ptr< Impl > | getImpl () |
| void | init (const String &img, int flags) |
| const Mat & | operator[] (int index) |
| void | releaseCache (int index) |
| size_t | size () const |
保护属性 | |
| Ptr< Impl > | pImpl |
用于按需读取多页图像。
ImageCollection 类提供了迭代器 API 来按需读取多页图像。创建图像集合的迭代器并迭代集合。使用 operator* 解码必要的页面。
如果集合按顺序递增,则页面解码的性能为 O(1)。如果用户想要访问随机页面,则时间复杂度为 O(n),因为必须每次重新初始化集合才能转到正确的页面。但是,在此过程中不会解码中间页,因此通常速度非常快。这是必需的,因为多页编解码器不支持向后移动。解码一页后,它会存储在集合缓存中。因此,尝试从已解码的页面获取 Mat 对象为 O(1)。如果需要内存,可以使用 .releaseCache() 方法来释放缓存的索引。如果所有页面都解码到内存中,则空间复杂度为 O(n)。用户可以按需解码和释放图像。
| cv::ImageCollection::ImageCollection | ( | ) |
| cv::ImageCollection::ImageCollection | ( | const String & | filename, |
| int | flags ) |
| const Mat & cv::ImageCollection::at | ( | int | index | ) |
| iterator cv::ImageCollection::begin | ( | ) |
| iterator cv::ImageCollection::end | ( | ) |
| Ptr< Impl > cv::ImageCollection::getImpl | ( | ) |
| void cv::ImageCollection::init | ( | const String & | img, |
| int | flags ) |
| const Mat & cv::ImageCollection::operator[] | ( | int | index | ) |
| void cv::ImageCollection::releaseCache | ( | int | index | ) |
| size_t cv::ImageCollection::size | ( | ) | const |
|
保护 |