Answer the question
In order to leave comments, you need to log in
How to identify a circle in an image?
Good afternoon. I want to find the coordinates of these little circles. But the below code doesn't find anything. How do I change definition settings. Or how to deal with the image.
cvtColor(img, gray, CV_BGR2GRAY);
//cvtColor(img, HSV, COLOR_BGR2HSV);
//GaussianBlur(gray, gray, Size(9, 9), 2, 2);
std::vector<Vec3f> circles;
HoughCircles(gray, circles, HOUGH_GRADIENT, 1,100, 200, 100, 0, 0);
for (size_t i = 0; i < circles.size(); i++)
{
Vec3i c = circles[i];
circle(img, Point(c[0], c[1]), c[2], Scalar(0, 0, 255), 3, LINE_AA);
circle(img, Point(c[0], c[1]), 2, Scalar(0, 255, 0), 3, LINE_AA);
}
Answer the question
In order to leave comments, you need to log in
And if you apply a filter to highlight the contour, for example, Sobel?
And after it cv::HoughCircles .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question