【问题标题】:open cv Feature matching using given coordinates使用给定坐标的opencv特征匹配
【发布时间】:2015-09-10 13:54:19
【问题描述】:

我正在使用 openCv、FAST 特征检测和蛮力匹配在立体图像之间进行特征匹配。

            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);

不过我想做的是,使用光流跟踪左帧上的点,然后使用特征匹配匹配右帧上的点。

是否可以向特征匹配函数提供您希望匹配的点的像素坐标?

【问题讨论】:

  • 您在代码中的何处插入“光流跟踪”?在“FastFeatureDetector”之前还是在 FastFeatureDetector 和 OrbDescriptorExtractor 之间?
  • 目前在特征检测之前,但我没有将跟踪点链接到提取器,因为我不确定如何......

标签: c++ opencv feature-detection feature-extraction opticalflow


【解决方案1】:

您不能将其指定给匹配器,但您可以在提取时限制点数。在您的代码中,keypoints1keypoints2 可以是提取器的输入,仅用于您希望匹配的点。因此,您应该执行以下操作:

// 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);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-01-16
    • 2018-03-18
    • 1970-01-01
    • 2018-04-27
    • 2015-08-23
    • 2013-07-31
    • 2013-11-15
    相关资源
    最近更新 更多