cv::Mat image = cv::imread("0009.jpg", cv::IMREAD_GRAYSCALE);
assert(image.data != nullptr);
std::vector<cv::Point2f> pointBuf;
cv::SimpleBlobDetector::Params params;
params.filterByArea = true;
params.minArea = 1e3;
params.maxArea = 2 * 1e5;
// Storage for blobs
std::vector<cv::KeyPoint> keypoints;
auto blobDetector = cv::SimpleBlobDetector::create(params);
// Detect blobs
blobDetector->detect(image, keypoints);
cv::Mat im_with_keypoints;
drawKeypoints(image, keypoints, im_with_keypoints, cv::Scalar(0, 0, 255), cv::DrawMatchesFlags::DRAW_RICH_KEYPOINTS);
auto find = cv::findCirclesGrid(image, cv::Size(7, 7), pointBuf, cv::CALIB_CB_SYMMETRIC_GRID, blobDetector);
if (find)
{
cv::cornerSubPix(image, pointBuf, cv::Size(7, 7), cv::Size(-1, -1), cv::TermCriteria(cv::TermCriteria::EPS + cv::TermCriteria::COUNT, 300, 0.001));
}
here is my code, when i use blobDetector->detect(image, keypoints); this code work well, but when i use cv::findCirclesGrid(image, cv::Size(7, 7), pointBuf, cv::CALIB_CB_SYMMETRIC_GRID, blobDetector); this code return failed. I use the same blobDetector, is someone know why?