打开cv使用给定坐标进行特征匹配
open cv Feature matching using given coordinates
我使用openCv、FAST特征检测和Brute力匹配在立体图像之间进行特征匹配。
FastFeatureDetector detector(threshold);
detector.detect(img1, keypoints1);
detector.detect(img2, keypoints2);
OrbDescriptorExtractor extractor;
extractor.compute(img1, keypoints1, descriptors1);
extractor.compute(img2, keypoints2, descriptors2);
BFMatcher matcher(NORM_L2);
matcher.match(descriptors1, descriptors2, matches);
不过,我想做的是,使用光流跟踪左框上的点,然后使用特征匹配匹配右框上的那些点。
是否可以向特征匹配函数提供您希望匹配的点的像素坐标?
您不能将其指定给匹配器,但可以在提取时限制点。在您的代码中,keypoints1和keypoints2可以是仅希望匹配的点的提取器的输入。因此,您应该执行以下操作:
// perform "optical flow tracking" and get some points
// for left and right frame
// convert them to cv::KeyPoint
// cv::KeyPoint keypoints1; // left frames
// cv::KeyPoint keypoints1; // right frames
// extract feature for those points only
OrbDescriptorExtractor extractor;
extractor.compute(img1, keypoints1, descriptors1);
extractor.compute(img2, keypoints2, descriptors2);
// match for the descriptors computed at the pixel coordinates
// given by the "optical flow tracking" only
BFMatcher matcher(NORM_L2);
matcher.match(descriptors1, descriptors2, matches);
相关文章:
- QGraphicsPolygonItem在拖动时未更新QPolygonF坐标
- 如何声明特征矩阵,然后通过嵌套循环初始化它
- 在C++中使用GDAL可以将图像的像素坐标转换为lat,long吗
- 特征::矩阵<双精度,1,3> 结构类型函数中的返回类型函数
- UE4-如何在给定4个屏幕坐标的情况下缩放纹理或材质
- 有没有一种方法可以通过"typedef"为重新定义的基本类型定义特征和强制转换运算符
- 特征命名访问向量段
- 将特征矩阵的向量设置为0
- 特征:模板函数中矩阵的平面图
- basic_string的前导/尾部不区分空格的特征
- 特征 3 类的模板专用化
- 特征 c++:复矩阵的面积双曲正切(atanh)
- C++ 中的特征向量计算
- 根据C++标准的定义实现"is_similar"类型特征
- C++类型特征,以查看是否可以<uint32_t>对类型"K"的任何变量调用"static_cast(k)"
- 有没有办法找到特征矩阵系数的中值?
- 在特征中创建与w!= 1的均匀坐标
- Opencv -从特征匹配中获取像素坐标
- 我们如何同时使用汉明距离和坐标之间的距离来匹配特征
- 打开cv使用给定坐标进行特征匹配