HoughCircles low resolution (Patch #951)
Description
Hi,
cvHoughCircles has problems detecting small circles. I think that I have found a couple of bugs.
I attached the source image the circle is not detected using these parameters
cvHoughCircles( image, storage, CV_HOUGH_GRADIENT, 1, 10, 100, 10, 5, 20 );
The first bug is in line 931, 932. The coordinates (x,y) of the cell should be
y = ofs/(acols+2);
x = ofs - (y)*(acols+2);
As an enhancement, in the following line, the center of the cell should be located in the center of the cell, not in the corner
float cx = (float)( (x + 0.5)*dp), cy = (float)((y + 0.5)*dp);
The next one, i'm not sure if it is a bug or not, in line 936
int max_count = R_THRESH;
R_THRESH=30 is a constant
This produces that the circle is not detected because of line 983
(r_best < FLT_EPSILON && start_idx - j >= max_count) )
shouldn't max_count be initialized to cero?
And finally in line 995, the support of the circle must be tested with the parameter acc_threshold, instead of the constant R_THRESH
if( max_count > acc_threshold )
I'm using OpenCV2.2 on Windows XP, 32bit, compiled with VS2008
I found this similar ticket #518
I also attach a test with the image from this ticket
Regards
Javier Barandiaran Martirena
http://jbarandiaran.googlepages.com/
Related issues
related to Bug #518: HoughCircles detects too small circles | Done |
Associated revisions
added houghcircles sample, improved circle detection (ticket #951)
Merge pull request #951 from apavlenko:fix_java_test_randshuffle
History
Updated by Alexander Shishkov about 13 years ago
- Description changed from Hi, cvHoughCircles has problems detecting small circles. I think that I have ... to Hi, cvHoughCircles has problems detecting small circles. I think that I have ... More
Updated by Alexander Shishkov almost 13 years ago
- Tracker changed from Bug to Patch
- Priority changed from High to Normal
- Target version deleted ()
Updated by Alexander Shishkov almost 13 years ago
- Assignee deleted (
Vadim Pisarevsky)
Updated by Vadim Pisarevsky almost 13 years ago
thanks! your patch has been applied in r7658
Updated by Vadim Pisarevsky almost 13 years ago
- Status changed from Open to Done
- Assignee set to Vadim Pisarevsky
Updated by Alexander Shishkov almost 13 years ago
- Target version set to 2.4.0
Updated by Andrey Kamaev almost 13 years ago
- Description changed from Hi, cvHoughCircles has problems detecting small circles. I think that I have ... to Hi, cvHoughCircles has problems detecting small circles. I think that I have ... More