04-21-2014 03:43 PM
Hi,
I've been experimenting to understand "roundness" in Find Circular Edge - which seems to be the residual from "circle fit". I noticed some weird behaviour, and to understand it, I wrote a program that scales the width of a "perfect" circle from 0.5 to 1.5.
I expected some glitches, jumps,.. due to discretization, rounding,.. etc, but then I stumbled upon behaviour that makes no sense: When I detect a circle that is partly outside of the image, the roundness is suddenly at very low value.
To visulalize, I'm talking about such an image:
The roundness behaves like this:
I am not sure if it is just my vi (I'm attaching the example picture and the experimental vi), but can anyone explain this behaviour and give me some idea how to avoid it?
Thanks,
Birgit
Solved! Go to Solution.
06-09-2014 01:09 AM
Please clarify. The circle is being drawn by taking edge pints detected. The edge points gives an arc as seen in your picture. I dont understand what is unusal
06-09-2014 01:42 AM
The results of the "roundness" aka residual have a glitch once the detected circle is outside of the image.
Allow me to add a "normal" picture with a low residual of 0.17
High residual of 21,3
This behaviour sort of models how well the shape fits with the calculated circle.
And that's what I expect.
However, in the second the algorithm "finds" a circle that is outside of the image boundaries, the residual "jumps" and is suddenly very, very low, as if one had a shape that would fit with the calculated circle.
This, for example, has a residual of 0,27
06-09-2014 03:20 AM
Hmmm. I will check this .
06-09-2014 10:41 AM
Your last ellipse is only locating three points. You can only fit one circle to three points, and it is a perfect fit. Thus the residual would be very small. It has nothing to do with the circle being outside the boundaries of the image.
Your second test finds a large number of points, and the fit is not very good for all the points. Thus the residual is large.
Your edge search has to find a large number of points to be able to fit the circle accurately. You would need a much smaller angular step on your edge search, especially if you are trying to find objects from the outside.
Bruce
06-09-2014 11:22 AM
Hi Bruce,
Of course! I incorrectly assumed that the number is calculated using some contour-based method, but of course, looking at the very pictures I did today, your interpretation makes much more sense. Sometimes you don't see the forest..
And of course, this "roundness"/residue depends very much on the position of the search center and stepsize, and isn't as suitable to what I'd like to do. I was hoping for something that would be at least rotation-invariant, if not scale-invariant..
Thanks,
Birgit