OpenCV
4.10.0-dev
Open Source Computer Vision
|
To read multi-page images on demand. More...
#include <opencv2/imgcodecs.hpp>
Classes | |
struct | iterator |
Public Member Functions | |
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 |
Protected Attributes | |
Ptr< Impl > | pImpl |
To read multi-page images on demand.
The ImageCollection class provides iterator API to read multi-page images on demand. Create iterator to the collection of the images and iterate over the collection. Decode the necessary page with operator*.
The performance of page decoding is O(1) if collection is increment sequentially. If the user wants to access random page, then the time Complexity is O(n) because the collection has to be reinitialized every time in order to go to the correct page. However, the intermediate pages are not decoded during the process, so typically it's quite fast. This is required because multi-page codecs does not support going backwards. After decoding the one page, it is stored inside the collection cache. Hence, trying to get Mat object from already decoded page is O(1). If you need memory, you can use .releaseCache() method to release cached index. The space complexity is O(n) if all pages are decoded into memory. The user is able to decode and release images on demand.
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 |
|
protected |