使用视觉词袋计算图像描述符的类。 更多...
#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 |
|
保护 |
此类文档由以下文件生成