c++字袋集群数组大小问题
c++ Bag Of Words Clustered Array Size Issue
我正在尝试创建一个Bag Of Words程序,使用ORB
作为我的detector
,extractor
和BruteForce
作为matcher
。
一切都很顺利。
但我担心的是,当我尝试对描述符数组进行聚类时,它会从中缩小
[32 x several thousand odd]
至
[32 x 1]
我也不太明白32是从哪里来的,这些程序目前只读取14张图像。
代码:
cout << " -- All Other Images Features Array Size: " << allImgFeaturesUnclustered.size();
BOWKMeansTrainer allImgBowTrainer(dictionarySize, termCrit, retries, flags);
Mat allImgDictionary = allImgBowTrainer.cluster(allImgFeaturesUnclustered);
BOWImgDescriptorExtractor allImgBowImgDesExtr(extractor,matcher);
allImgBowImgDesExtr.setVocabulary(allImgDictionary);
cout << " -- All Images Dictionary Size: " << allImgDictionary.size();
在最上面一行,当保留为原始大小时,对于所有图像中的所有描述符,Array显示为[32 x 6969]
。
在底线,在它们被集群后,阵列显示为[32 x 1]
我已经做了这只是一个图像,它仍然从[32 x 458]
到[32 x 1]
这是对的吗?在过去的2-3周里,我一直在自学c++和OpenCV,所以如果这是正常的,我很抱歉。
在您的案例中,32似乎既是ORB
的特征大小,也是dictionary size
的特征大小。因此,如果您的特征大小是64,字典大小是16,那么您将看到[64 x 458]
到[16 x 1]
。
请看一下这个。
相关文章:
- cpp二进制搜索问题,计算给定数组中输入元素的出现次数
- 输入std::数组时出现问题
- 类对象数组的问题会导致崩溃
- 传递二维数组时出现问题
- 从 C++ 中的函数返回数组地址问题
- 使用数组时出现问题
- 打印问题.我在数组中打印值时遇到一些问题
- C++:__aligned(__alignof__) 导致字符数组数据出现问题?
- 将字节数组转换为带有字节序问题的指针
- C++ 填充数组时遇到问题
- 遇到此问题时遇到困难:允许用户输入数组的值并使用 for,而循环也输出输入的最大数字
- 这是使用回溯的 nqueen 问题,但我使用了动态 2d 数组,我的程序编译良好,但不返回任何输出
- 当我尝试通过 arduino 上的引用传递布尔数组时出现问题
- 我正在尝试解决一个需要数组总和值但代码不起作用的问题,我想做这样的事情
- 编写 cin.get() 以接收字符数组时出现问题
- 在 C++ Consol 中的数组中执行用户命令时出现问题
- 存储另一个函数返回的布尔数组时遇到问题
- 当我在 CLion 中读取数组中的 txt 文件时C++编码问题
- 运行时C++数组初始化问题
- 我在解决此错误时遇到问题.我正在努力在主函数中传递数组