LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting an image into numeric array?

I want to sum all the pixel values in a image. I was thinking of using the Add Array Elements VI. Is their an easy way to convert an U8 or an I16 bit image into a numeric array? Thank you in advance.
0 Kudos
Message 1 of 3
(8,144 Views)
Is this a BW image? (If the image is paletted or color, a summing operation is poorly defined! ;))
Just convert your image data to a 2D boolean array using unflatten pixmap, then feed the 1bit pixmap to "boolean to 0..1" followed by the SUM operation (in case it overflows, you might want to convert it to a better representation before summing, e.g. DBL. "boolean to 0,1" generates I16).

Message Edited by altenbach on 06-01-2005 02:44 PM

0 Kudos
Message 2 of 3
(8,137 Views)
Hi kbaker,

Altenbach example is good if you are dealing with a pure black and white image. However, I have a feeling that you might be referring to a grayscale image, so in that case I attached an example of how to get the numeric image array of such an image and at the same time summing the pixel values.

Have fun!

Message Edited by Philip C. on 06-02-2005 09:37 PM

- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Message 3 of 3
(8,126 Views)