使用視覺詞袋計算影像描述符的類。 更多...
#include <opencv2/features2d.hpp>
使用視覺詞袋計算影像描述符的類。
此類計算包含以下步驟
- 計算給定影像及其關鍵點集的描述符。
- 為每個關鍵點描述符找到詞彙表中最近的視覺詞。
- 將詞袋影像描述符計算為影像中遇到的詞彙詞的歸一化直方圖。直方圖的第 i 個 bin 是給定影像中詞彙表的第 i 個詞的頻率。
◆ BOWImgDescriptorExtractor() [1/2]
| Python |
|---|
| cv.BOWImgDescriptorExtractor( | dextractor, dmatcher | ) -> | <BOWImgDescriptorExtractor object> |
建構函式。
- 引數
-
| dextractor | 描述符提取器,用於計算輸入影像及其關鍵點的描述符。 |
| dmatcher | 描述符匹配器,用於查詢影像的每個關鍵點描述符的訓練詞彙表中最近的詞。 |
◆ BOWImgDescriptorExtractor() [2/2]
| cv::BOWImgDescriptorExtractor::BOWImgDescriptorExtractor |
( |
const Ptr< DescriptorMatcher > & | dmatcher | ) |
|
| Python |
|---|
| cv.BOWImgDescriptorExtractor( | dextractor, dmatcher | ) -> | <BOWImgDescriptorExtractor object> |
這是一個過載的成員函式,為方便起見而提供。它與上述函式的不同之處僅在於它接受的引數。
◆ ~BOWImgDescriptorExtractor()
| virtual cv::BOWImgDescriptorExtractor::~BOWImgDescriptorExtractor |
( |
| ) |
|
|
virtual |
◆ compute() [1/2]
| void cv::BOWImgDescriptorExtractor::compute |
( |
InputArray | image, |
|
|
std::vector< KeyPoint > & | keypoints, |
|
|
OutputArray | imgDescriptor, |
|
|
std::vector< std::vector< int > > * | pointIdxsOfClusters = 0, |
|
|
Mat * | descriptors = 0 ) |
使用設定的視覺詞彙計算影像描述符。
- 引數
-
| image | 計算描述符的影像。 |
| keypoints | 在輸入影像中檢測到的關鍵點。 |
| imgDescriptor | 計算出的輸出影像描述符。 |
| pointIdxsOfClusters | 屬於群集的關鍵點的索引。這意味著 pointIdxsOfClusters[i] 是屬於第 i 個群集(詞彙表的詞)的關鍵點索引,如果它非零則返回。 |
| descriptors | 如果非零,則返回影像關鍵點的描述符。 |
◆ compute() [2/2]
| void cv::BOWImgDescriptorExtractor::compute |
( |
InputArray | keypointDescriptors, |
|
|
OutputArray | imgDescriptor, |
|
|
std::vector< std::vector< int > > * | pointIdxsOfClusters = 0 ) |
這是一個過載的成員函式,為方便起見而提供。它與上述函式的不同之處僅在於它接受的引數。
- 引數
-
| keypointDescriptors | 計算出的描述符與詞彙表匹配。 |
| imgDescriptor | 計算出的輸出影像描述符。 |
| pointIdxsOfClusters | 屬於群集的關鍵點的索引。這意味著 pointIdxsOfClusters[i] 是屬於第 i 個群集(詞彙表的詞)的關鍵點索引,如果它非零則返回。 |
◆ compute2()
| void cv::BOWImgDescriptorExtractor::compute2 |
( |
const Mat & | image, |
|
|
std::vector< KeyPoint > & | keypoints, |
|
|
Mat & | imgDescriptor ) |
|
inline |
| Python |
|---|
| cv.BOWImgDescriptorExtractor.compute( | image, keypoints[, imgDescriptor] | ) -> | imgDescriptor |
◆ descriptorSize()
| int cv::BOWImgDescriptorExtractor::descriptorSize |
( |
| ) |
const |
| Python |
|---|
| cv.BOWImgDescriptorExtractor.descriptorSize( | | ) -> | retval |
如果設定了詞彙表,則返回影像描述符大小。否則,它返回 0。
◆ descriptorType()
| int cv::BOWImgDescriptorExtractor::descriptorType |
( |
| ) |
const |
| Python |
|---|
| cv.BOWImgDescriptorExtractor.descriptorType( | | ) -> | retval |
◆ getVocabulary()
| const Mat & cv::BOWImgDescriptorExtractor::getVocabulary |
( |
| ) |
const |
| Python |
|---|
| cv.BOWImgDescriptorExtractor.getVocabulary( | | ) -> | retval |
◆ setVocabulary()
| void cv::BOWImgDescriptorExtractor::setVocabulary |
( |
const Mat & | 詞彙表 | ) |
|
| Python |
|---|
| cv.BOWImgDescriptorExtractor.setVocabulary( | 詞彙表 | ) -> | 無 |
設定視覺詞彙表。
- 引數
-
| 詞彙表 | 詞彙表(可以使用 BOWTrainer 的繼承者進行訓練)。詞彙表的每一行都是一個視覺詞(聚類中心)。 |
◆ dextractor
◆ dmatcher
◆ vocabulary
| Mat cv::BOWImgDescriptorExtractor::vocabulary |
|
保護 |
此類文件由以下檔案生成