Forums > Jitter

Mean of total values of a matrix' plane without the 0 value pixels

November 5, 2013 | 6:07 am

Hi folks,

Any idea how I can find out the mean of all the values of a plane from a matrix?
Except for the 0 value which would ruin the whole calculations, of course.

Thank you for looking into this,
ygr

<code>

– Pasted Max Patch, click to expand. –

</code>


November 5, 2013 | 6:23 am

jit.3m


November 5, 2013 | 6:28 am

First thing is figuring out a way to get the pixels with 0 value out of the calculations.

And then calculate the mean from what remains.

By the way, I know about [jit.3m] mean value but the thing with the 0′s still remain


November 5, 2013 | 6:29 am

Thank you, Tobias. I just read your message. Still trying to figure out how to exclude the 0′s from the whole configuration.


November 5, 2013 | 10:08 am

jit.iter can help here.
Steps:
Calculate the number of non-black pixel occurrences
Calculate the sum of all the pixels in the image (black is 0 so you don’t need to filter it).
Divide it by the number of non-black pixels.

This way you get a higher average, since you’re not counting the black pixels…

<code>

– Pasted Max Patch, click to expand. –

</code>


November 5, 2013 | 12:35 pm

Oh, my god!

You are a genius! Thank you so much!!


Viewing 6 posts - 1 through 6 (of 6 total)