首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >opencv中的崩溃检测功能(ORB和BRISK)

opencv中的崩溃检测功能(ORB和BRISK)
EN

Stack Overflow用户
提问于 2015-11-11 20:29:57
回答 2查看 702关注 0票数 1

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

代码语言:javascript
复制
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->detect(img,kp);我不知道问题是什么,我尝试了其他形式的do it,但在调用detect()时都崩溃了。

我尝试使用BRISK,这个问题在检测崩溃的调用中也是一样的。我轻快地为simplify做了下一个:

代码语言:javascript
复制
Ptr < BRISK > detector = BRISK::create();
vector <KeyPoint> kp;
detector->detect(img,kp);

这正变得令人恼火。

我使用的是windows 10的visual studio 2015中的opencv 3。

很抱歉我的英语,谢谢你的回答。

EN

回答 2

Stack Overflow用户

发布于 2020-05-10 17:36:35

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

票数 1
EN

Stack Overflow用户

发布于 2015-11-12 10:08:52

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

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

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

https://stackoverflow.com/questions/33650585

复制
相关文章

相似问题

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