HoughCircles low resolution (Patch #951)


Added by Javier Barandiaran almost 14 years ago. Updated almost 13 years ago.


Status:Done Start date:
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:imgproc, video
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

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/


hough.patch - SVN patch (2.2 kB) Javier Barandiaran, 2011-03-21 03:34 pm

img.png - test image (788 Bytes) Javier Barandiaran, 2011-03-21 03:35 pm

canny.png - canny edges (235 Bytes) Javier Barandiaran, 2011-03-21 03:35 pm

sobelx.png - sobrel gradient x (1.1 kB) Javier Barandiaran, 2011-03-21 03:35 pm

sobely.png - sobrel gradient y (1004 Bytes) Javier Barandiaran, 2011-03-21 03:35 pm

1_circle.png - test (70.6 kB) Javier Barandiaran, 2011-03-21 03:35 pm


Related issues

related to Bug #518: HoughCircles detects too small circles Done

Associated revisions

Revision 7a62413c
Added by Vadim Pisarevsky almost 13 years ago

added houghcircles sample, improved circle detection (ticket #951)

Revision aa7f70c3
Added by Roman Donchenko almost 12 years ago

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

Also available in: Atom PDF