LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mean of R color values

Solved!
Go to solution

Hi there,

 

 I am using the read jpg sub vi, I take the image data and after I decimate the array, three vetors each of each corresponding  to R ,G  and B are created.  I calculate the mean value of R in the way shown in my attached program and I find two different values. Can one one explain why that happens?

 

Thank you

0 Kudos
Message 1 of 3
(2,402 Views)
Solution
Accepted by topic author vlonjati

It would be better if you put real data into your input array, make that data the default values for the array, then save the file and upload.

 

How many elements are in your array?

 

If you have only 2 elements, then the top mean calculates the mean of those 2.  Your formula node creates a 256 element array that is filled with zeroes.  So only as many elements in your first array will get placed into the new array.  All remaining elements will remain zero, but they will factor into the calculation of the mean.

0 Kudos
Message 2 of 3
(2,379 Views)

Hi Ravens Fan,

 

Thank you for your answer, that was a stupid mistake, now that I check the size of R it is 480000 which correspond to the size of 800X600 pixel, i.e. of the picture.

 

0 Kudos
Message 3 of 3
(2,354 Views)