| OpenCV 5.0.0alpha Open Source Computer Vision

Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Attributes | List of all members
cv::ImageCollection Class Reference
Image file reading and writing

To read multi-page images on demand. More...

`#include <opencv2/imgcodecs.hpp>`

Collaboration diagram for cv::ImageCollection:

## 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

## Detailed Description

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.

## Constructor & Destructor Documentation

## ◆ ImageCollection() [1/2]

cv::ImageCollection::ImageCollection | ( |  | ) |

## ◆ ImageCollection() [2/2]

cv::ImageCollection::ImageCollection | ( | const String & | filename,
|  | int | flags )

## Member Function Documentation

## ◆ at()

const Mat & cv::ImageCollection::at | ( | int | index | ) |

## ◆ begin()

iterator cv::ImageCollection::begin | ( |  | ) |

## ◆ end()

iterator cv::ImageCollection::end | ( |  | ) |

## ◆ getImpl()

Ptr< Impl > cv::ImageCollection::getImpl | ( |  | ) |

## ◆ init()

void cv::ImageCollection::init | ( | const String & | img,
|  | int | flags )

## ◆ operator[]()

const Mat & cv::ImageCollection::operator[] | ( | int | index | ) |

## ◆ releaseCache()

void cv::ImageCollection::releaseCache | ( | int | index | ) |

## ◆ size()

size_t cv::ImageCollection::size | ( |  | ) | const

## Member Data Documentation

## ◆ pImpl

Ptr<Impl> cv::ImageCollection::pImpl
| protected

The documentation for this class was generated from the following file:

- opencv2/imgcodecs.hpp