我正在尝试编写用于 Blob 检测的代码,我正在按照这里的教程 https://www.learnopencv.com/blob-detection-using-opencv-python-c/ 我刚刚复制并粘贴了代码
Mat im = imread("blob.jpg", IMREAD_GRAYSCALE);
// Set up the detector with default parameters.
SimpleBlobDetector detector;
// Detect blobs.
std::vector<KeyPoint> keypoints;
detector.detect(im, keypoints);
// Draw detected blobs as red circles.
// DrawMatchesFlags::DRAW_RICH_KEYPOINTS flag ensures the size of the circle corresponds to the size of blob
Mat im_with_keypoints;
drawKeypoints(im, keypoints, im_with_keypoints, Scalar(0, 0, 255), DrawMatchesFlags::DRAW_RICH_KEYPOINTS);
// Show blobs
imshow("keypoints", im_with_keypoints);
当我运行它时,出现错误
drawKeypoints(im, keypoints, im_with_keypoints, Scalar(0, 0, 255), DrawMatchesFlags::DRAW_RICH_KEYPOINTS);
说“未处理的异常”,:Microsoft C++:cv::Exception
我该如何解决这个问题?