Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

What exactly is the roundness figure generated by IMAQ Find Circular Edge?

Is it a measure of pixels from the minimum to maximum diameter span of the data points (aka circularity). What numerical figure would a perfect circle return?
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 1 of 9
(5,902 Views)
Hello,

Roundness or residual represents the least square error of the fitted circle to the entire set of points.

The value you would receive if you had a perfect circle would be 0 since there would be no error. You can see the formula for this value if you look at the online help for the IMAQ Fit Cirlce under residual. This is the function that is called by IMAQ Find Circular Edge.

Regards,
Andy Bell
Applications Engineer
National Instruments
Message 2 of 9
(5,902 Views)

Can someone please point out the online help Andy is referring too, because I can't find it 😞

Thanks a lot!

0 Kudos
Message 3 of 9
(4,763 Views)

You can see the residual output formula:
 Residual indicates the least square error of the fitted circle over every given radial point.

Residual = where e i represents the distance from the i th input point to the perimeter of the circle.

 

Source: zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_fit_circle_2/

Thanks
uday
0 Kudos
Message 4 of 9
(4,760 Views)

Thanks for your quick answer udka!

 

Can I calculate the value e as : r - sqrt(Xi ^2 + Yi^2)

assuming the centre of the circle is at [0,0] ?

where r= radius best fit circle

 

Another thing bothers me:
Suppose you have 2000 X,Y points to describe your measured circle.
With given formula the residual is the sqrt of the sum of 2000 individual errors

Now I resample my data by 10 to end up with only 200 X,Y points.

Correct me if I'm wrong but the sqrt of the sum of 200 individual errors will alwyas be lower than one calculated from 2000 data points.

 

Does that mean that this result depends on the number of datapoints ?? !!! ??

 

Thanks for your insights!

0 Kudos
Message 5 of 9
(4,756 Views)

I hope attached vi will clear some things out

I calculate ei as described in previous post

Original dataset contains 3300 data points and I get an LS error of 31.159

Resampled dataset to only 134 data points, I get an LS error of 6.27

Please note that both dataset lays perfectly on top of each other, see graph.
Other results like best fit circle and original centre point are equal.

 

Thanks to point out what I'm doing wrong!

Best regards

0 Kudos
Message 6 of 9
(4,753 Views)

bump

Anyone any inputs... ...

0 Kudos
Message 7 of 9
(4,728 Views)

Hi Alain,

Usually for fitting error we estimate the MSE (Mean Square Error).

You need to devide acumulated error by the number of points. I don't see that in your code.

I am not sure about the IMAQ Find Circular Edge. But usually fit function preformance is estimated with MSE.

https://en.wikipedia.org/wiki/Mean_squared_error

 

Amit Shachaf
0 Kudos
Message 8 of 9
(4,656 Views)

Hi Alain,

 

If you are trying to estimate the "roundness" of anything, you could also think about particle analysis - aka shape factors. There are a number that could be relevant.. mostly Heywood Circularity (which is good if you compare the "same" object but vulnerable local surface characteristics) and type factor (a decent "global" operator for roundness that says little else).. Sometimes factors like "elongation" can be also interesting. Personally I also like "sphericity" (Ratio of the waddle disk diameter to the perimeter of the convex hull*PI) a lot.

 

What problem are you tryingto solve?


Birgit

0 Kudos
Message 9 of 9
(4,639 Views)