Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ Particle Analysis VI Ellipse Measurement Incorrect

I've tested the particle analysis vi's numbers related to ellipse measurements with just a perfect circle and the numbers it produces are obviously incorrect. Is there anything wrong with this VI or something that has to be done before it works.

 

I did this using the example, Particle Analysis Example and changed the following entry to display the ratio instead of the area and replaced the format into decimal into a format into float. The results are usually insanely off with ratios of 1.3+ or something while an actual circle should have a ratio of almost exactly 1. 

 

I also noticed a lot of measurements even on simple shapes are wildly off target for some reason even with the example.

 

Circle

 

Modification2.png

 

0 Kudos
Message 1 of 5
(4,200 Views)

Hi Aoawao,

 

I tried recreating your issue with the Particle Analysis Example, but I was unable to reproduce it. I used the image of the white circle that you provided and got a ratio of 1.1 instead of 1.3+. Even before modification of the example, the values I was getting seemed reasonable.

 

What version of LabVIEW and what OS are you using?

0 Kudos
Message 2 of 5
(4,156 Views)

I'm running windows 7 (64 bit) with labview 2012 (32 bit)

 

The ratio should be around 1.0 not anything else as I've tried using another fitting function in labview and other programs and they all produce 1.00 as the ratio which makes sense.

 

A ratio of 1.1 means the circle isn't very circular. (A ratio of 2 would mean it is elongated twice over the small radius) It gets worse when analyzing actual images compared to other programs and the ellipse fitting function. 

0 Kudos
Message 3 of 5
(4,149 Views)

Hi Aoawao,

I made the same measurements:

ellipse.png

The fact is that minor and major axes are not the same.

Have a look on the Vision concept manual on page 184-186 for more informations about how this ratio is measured.

Hope this helps

Regards

Message 4 of 5
(4,136 Views)

I tested the equations and they are slightly misleading in the documentation the formulas do not match what the description of the solution is (pg 186).

 

If you solve using the ellipse fitting results it returns the correct result but I don't know how the formula given in (pg 184) could ever solve the ellipse properly as it never results in valid numbers. (It as mentioned cannot handle the simple case of a circle having the same major/minor radius) Testing it against an actual dataset resulted in crazy numbers for things that are visably almost circular getting ratios of 1.5-2 which is non-sensical.

 

If you compare this to another vision program ImageJ their measurement function for ellipse works fast and returns a valid result. I may try to use the forumla they use as it uses the calculated moments which I believe labview provides as well as I wanted to have an accurate and fast way to measure ellipse ratios but the fitting function in labview appears to take quite a bit longer than the particle measurement function.

 

"In statistics, the measure that attempts to characterize some
  two-dimensional distribution of data points is the 'ellipse of
concentration' (see Cramer, Mathematical Methods of Statistics,   Princeton Univ. Press, 945, page 283).", EllipseFitter.java

 

The code they use doesn't seem to complex and it results in a ratio of 1.000 which is accurate enough.

Download All
0 Kudos
Message 5 of 5
(4,125 Views)