From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ Quantity returns standard deviation 0 when Min and Max are different.

I use IMAQ Quantify 2 to get the value from a particle in image. I receive a measure standard variation (standard deviation) 0 while the Min and Max value are different. I am not sure in which case this can happen.

 

 

0 Kudos
Message 1 of 5
(2,662 Views)

Hi NTT,

 

From the other statistics in your screenshot, it looks like the standard variance is 0 because the values of all of the pixels in the sample are nearly identical. What is the image you're using, and how do you have it masked?

Kathryn K.
Technical Support Engineer
National Instruments
http://ni.com/support
0 Kudos
Message 2 of 5
(2,608 Views)

Kathryn,

What I don't understand is variance is the sum of square of distance from each pixel value to the mean value divided by weighting. There is no negative element to subtract out the positive value. How can the sum become 0? I am sorry if my math logic is wrong here but I need detail explanation or simple example so I can understand this. 

I attach 2 files. One is the mask file. Another is the float image, you need to change the extension to .aipd first.

Download All
0 Kudos
Message 3 of 5
(2,591 Views)

 Hi NTT,

 

Because standard variance is related to standard deviation, if the standard deviation is 0, the variance will be as well. This article goes into more detail on what can cause the deviation to be 0, which should give you a good place to start.

 

I think that it is likely due to the fact that all of your pixels are so similar in value- the variance is so small that it comes through as 0. You could check this by running the same algorithm on a more varied image, and check whether the variance is still 0, or if it changes according to the range of values in the image.

 

 

Kathryn K.
Technical Support Engineer
National Instruments
http://ni.com/support
0 Kudos
Message 4 of 5
(2,575 Views)

Kathryn,

I have just collected a set of data for example. I built a VI to reconstruct image as well as calculate the standard variation and variance. There are different result between 2 functions.

0 Kudos
Message 5 of 5
(2,471 Views)