SimpleBlobDetector detect Exception Thrown

一个人想着一个人 提交于 2020-01-16 14:13:48

问题


I am using SimpleBlobDetector, of course to detect circles, in images grabbed from a camera and have undergone OpenCV color and morphological filters. I am receiving an

Exception thrown at 0x000... (opencv_imgproc249.dll) in .exe: Access violation reading location 0x000...

I am receiving this error on the line containing: d.detect(canny, keypoints); Here is a sample of my code:

std::vector<KeyPoint> keypoints;
SimpleBlobDetector d(params);
d.detect(canny, keypoints);
drawKeypoints(im, keypoints, im_with_keypoints, Scalar(0, 255, 0), DrawMatchesFlags::DRAW_RICH_KEYPOINTS);

canny is from the utilization of Canny(input, canny, 10, 30);

Can anyone potentially explain why I might be receiving this error?

EDIT:

I realized I was using the method of keypoint detection for OpenCV version < 3. I have since changed it to:

Ptr<SimpleBlobDetector> d = SimpleBlobDetector::create(params);
std::vector<KeyPoint> keypoints;
d->detect(thresh, keypoints);
drawKeypoints(im, keypoints, im_with_keypoints, Scalar(0, 255, 0), DrawMatchesFlags::DRAW_RICH_KEYPOINTS);

However, now I have an error related to params. The following error reads:

E0312 - no suitable user defined conversion from "cv::SimpleBlobDetector::Params" to "const std::string" exists

I have copied this exactly from SimpleBlobDetector Tutorial and oddly have this issue.

来源:https://stackoverflow.com/questions/53202635/simpleblobdetector-detect-exception-thrown

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!