首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OpenCV ORB特性

OpenCV ORB特性
EN

Stack Overflow用户
提问于 2013-01-14 15:15:13
回答 1查看 2K关注 0票数 4

我正在使用ORB特征检测器和提取器从灰度图像列表中获取特征。问题是,如果我多次尝试检测\提取图像,我会从同一图像中获得不同的特征。因此,不可能在以后使用它们进行检测。

代码:

代码语言:javascript
复制
bmp=BitmapFactory.decodeResource(getResources(),R.drawable.t1);
Utils.bitmapToMat(bmp, mat);
FeatureDetector detector = FeatureDetector.create(FeatureDetector.ORB);
detector.detect(mat, keypoints);
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.ORB);
extractor.compute(mat, keypoints, features);

也许有人对此有所了解?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-01-14 15:39:21

这不应该是case..you应该获得一致的性能。然而,我分享了我的代码,以便在两个图像上使用Orb特征检测器以及Orb描述符提取器。您可以使用任何匹配器来匹配它们。希望这能帮到你。

代码语言:javascript
复制
#include "iostream"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/nonfree/nonfree.hpp>
#include <opencv2/nonfree/features2d.hpp>
#include <opencv2/flann/flann.hpp>
#include <opencv2/legacy/legacy.hpp>
#include <vector>


using namespace cv;
using namespace std;

int main()
{
    Mat image1,image2;
    imageA = imread("C:\\lena.jpg",0);
    imageB = imread("C:\\lena1.bmp",0);

    vector<KeyPoint> keypointsA,keypointsB;
    Mat descriptorsA,descriptorsB;

    std::vector<DMatch> matches;

    OrbFeatureDetector detector;

    OrbDescriptorExtractor extractor;

    BruteForceMatcher<Hamming> matcher;

    detector.detect(imageA,keypointsA);
    detector.detect(imageB,keypointsB);

    extractor.compute(imageA,keypointsA,descriptorsA);
    extractor.compute(imageB,keypointsB,descriptorsB);

    return 0;
 }
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14314526

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档