我有以下代码:
//newImg is a mat of an image and orderedKeyPoint is the result from Fast
cv::FREAK extractor;
cv::Mat queryDescriptors;
extractor.compute(newImg, orderedKeyPoint, queryDescriptors);
我正在尝试使用queryDescriptors.at ??>(r,0)访问单个异常描述符,其中r是任意有效的行值,但我不确定该类型。所有文档都声明它只是一个描述符,但是是Mat还是double或其他类型?这是最好的方法吗?
cv::Mat descriptor2 = queryDescriptors.at<cv::Mat>(2,0);
我希望能够通过采用单个描述符并将它们放在cv::Mat的行值中来从单个描述符中重建queryDescriptors(描述符垫),例如:
queryDescriptors.at<cv::Mat>(2,0) = descriptor2;
任何帮助或见识将不胜感激,
以撒
最佳答案
FREAK描述符是具有64个cols和numkeypoints行的uchar Mat。
因此,要了解其中的一个元素:
uchar elm = descriptor.at<uchar>(row,col);
其中row是关键点ID,而col是元素ID。
关于opencv - 怪异描述符行类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16670844/