# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Mean of R color values

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

Message 1 of 3
(2,279 Views)
Solution
Accepted by topic author vlonjati

## Re: Mean of R color values

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.

Message 2 of 3
(2,256 Views)

## Re: Mean of R color values

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.

Message 3 of 3
(2,231 Views)