![]() |
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 |
|
保護 |