For the function of HoughCircles I have my code written this way
//Debugging purpose
cout << "2" << endl;
//Apply HoughCircle function
HoughCircles(src_gray2, circles, CV_HOUGH_GRADIENT,
2, // accumulator resolution (size of the image / 2)
5, // minimum distance between two circles
dparam1, // Canny high threshold
dparam2, // minimum number of votes
minR, maxR); // min and max radius
//Debugging purpose
cout << "3" << endl;
The dparam1 dparam2 minR and MaxR are slider bars. After this code, is the standard way of drawing the circle on the ROI.
When running the code, the code always stops between 2 and 3. Also i limited the number of circles being drawn to 5 to prevent overloading.
Now the problem is that the code is slow and hang because of this part. So is there a way to speed up this thing, or limit the number of circles being DETECTED? I only have one circle to detect at a time.
NOTE: The dparam1 and 2 are set to around 160 minR and max R are set to 0 as size of circles are unknown.
Thank you
↧