07-15-2021 09:07 AM - edited 07-15-2021 09:10 AM
Hi All,
I would like to detect circle on image - already edge detected and threshold-ed . Circle is white on black background. And I would like to overlay detected circle over white pixels.
NI IMAQ Detect Circles is detecting circle on edge between black and white pixels. And two circles are detecting as well, one internal on black->white edge and second on white->black edge.
As you should see picture could be 'noise' and from this reason something like Hough transform would be best. I think.
Thank you for your time.
Best regards
Peter
07-15-2021 11:10 AM
I would be interested to see the original unprocessed image. I think there might be better ways to approach the problem.
What is the pass/fail criteria for the circle, or are you just locating it for position?
Bruce
07-15-2021 11:58 AM
Hi Bruce
Thank you for replay.
Goal is to find circle XY location and verify that size is as expected +/-5 % ish. Circle could be partial because it could be in shadow of some component.
Raw image is not image but 3D cloud converted to 2D raster and edge detected and thresholded to extract features.
From this reason I would like my circle radius + XY position because this is edge of object of interest.
I implemented my own Hough transormation in LV but I would like something faster. And I expected then IMAQ could do it.
07-15-2021 02:22 PM
Is the circle always roughly in the same position? If it doesn't move around too much, you can use a fixed annulus ROI and use IMAQ Find Circular Edge. That should do a good job.
If the circle moves around quite a bit and you don't know where it will be in the image, you will need to do two steps. The first will be to locate it, then measure it. The strategy for locating it would depend on the amount of movement.
Bruce
07-15-2021 02:48 PM
It is a lot harder to locate the circle when all you have is the edge.
I did a little testing in Vision Assistant, and the best tool I found was Shape Matching (under Machine Vision). When I search for a circle and allow large gaps, it finds it pretty quickly. It may not be a perfect circle, which makes it harder to locate. Finding an ellipse might work better. Setting the right ranges would find it accurately.
The same tool is available in LabVIEW.
Bruce
07-15-2021 03:01 PM
The more you know about the data, the simpler the required algorithm.
If I do a 2D convolution with a small set of circles and keep the one that results in the largest amplitude, I get pretty close (Of course the center is quantized to pixels, but that could be improved):
Here is the peak convolution amplitude as a function of radius:
... and yes, if you explore a larger range of radii, you even get a second peak at the smaller circle
07-22-2021 06:02 AM
Hi Bruce
Thank you for suggestion.
I am going to try it next week.
Best regards
Peter
07-22-2021 06:03 AM
Hi Altenbach,
Thank you for suggestion.
I am going to try it next week.
Best regards
Peter
07-22-2021 11:31 AM
Hi Peter,
It looks from the image you are trying to locate fiducials on electronic board.
Is that the case? I was working on project like that in the past.
What are your challenges? What are you trying to do?
For us the precision of finding the fiducial was the big issue.
But we had initial starting point that is close for the algorithm