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

    Nov 05 2013 | 2:07 pm
    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,

    • Nov 05 2013 | 2:23 pm
    • Nov 05 2013 | 2:28 pm
      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
    • Nov 05 2013 | 2:29 pm
      Thank you, Tobias. I just read your message. Still trying to figure out how to exclude the 0's from the whole configuration.
    • Nov 05 2013 | 6:08 pm
      jit.iter can help here.
      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...
    • Nov 05 2013 | 8:35 pm
      Oh, my god!
      You are a genius! Thank you so much!!