【问题标题】:Crashing detect function in opencv(ORB and BRISK)opencv中的崩溃检测功能(ORB和BRISK)
【发布时间】:2016-02-12 13:06:31
【问题描述】:

我正在尝试使用检测器 ORB 获取图像中的关键点,但总是出现异常和崩溃,我的代码是下一个。

vector < KeyPoint > kp;

int nfeatures = 500;
float scaleFactor = 1.2f;
int nlevels = 8;
int edgeThreshold = 15;
int firstLevel = 0;
int WTA_K = 2;
int scoreType = ORB::HARRIS_SCORE;
int patchSize = 31;
int fastThreshold = 20;

Ptr < ORB > detector = ORB::create(
    nfeatures,
    scaleFactor,
    nlevels,
    edgeThreshold,
    firstLevel,
    WTA_K,
    scoreType,
    patchSize,
    fastThreshold );

detector->detect(img, kp);
cout << "Found " << kp.size() << " Keypoints " << std::endl;

Mat out;
drawKeypoints(img, kp, out, Scalar::all(255));

imshow("Kpts", out);

img 是提前声明的,问题是何时做检测器->detect(img, kp);而且我不知道是什么问题,我正在尝试其他形式的操作,但在检测()的调用中都崩溃了。

我尝试使用 BRISK 并且在检测崩溃的调用中问题是相同的。 为了简化,我轻快地做了下一个:

Ptr < BRISK > detector = BRISK::create();
vector <KeyPoint> kp;
detector->detect(img,kp);

这让人恼火。

我在带有 windows 10 的 Visual Studio 2015 中使用 opencv 3。

对不起我的英语,谢谢你的回答。

【问题讨论】:

    标签: exception-handling detect opencv3.0 orb brisk


    【解决方案1】:

    好的,我用 cmake 和 opencv_contrib 解决了我为 Visual Studio 构建 opencv 的问题,如果有人有同样的问题,我会按照下一个链接的说明进行操作:

    http://audhootchavancv.blogspot.in/2015/08/how-to-install-opencv-30-and.html

    【讨论】:

      【解决方案2】:

      这个错误在今天的 CV2 版本4.2.0 中仍然存在。我同样尝试使用cv2.ORB() 进行初始化,收到~00x5 error,尝试ORB_create(),它最终成功了!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-07-02
        • 1970-01-01
        • 2021-09-01
        • 2014-06-20
        • 1970-01-01
        • 2018-01-15
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多