LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How 2D Value Array to Bitmap Image in LabView?

I am going to be performing various digital image processing routines through labview 7 express and start out with a 2D matrix of values ranging from 0 to 1e-6 or higher and would like to convert this to a 8 or 16 bit greyscale image, pref. .jpg but whatever format is the easiest is fine ( I think .bmp probably is the easiest?).
It's easy enough to convert my values into the integer range 0-255 for 8 bit greyscale without losing any info... really I just don't know how to take my matrix of values 0-255 and place it in a proper format for reading as .jpg or .bmp. Can anyone help me?

Once I get past this stepping stone I can convolute to my hearts content, so any help is appreciated!

Thanks

Jonathan Frey

Also is there a way to do this easily in LabView even though I don't have access to the IMAQ suite? (I've no experience with it but heard that's a great image processing tool)
0 Kudos
Message 1 of 6
(16,187 Views)
You will find all you need in the palette of picture functions.

Feed your array into "flatten pixmap", add a color table (greyscale in you case), and use "write JPEG File" to write the file. In a similar way you can also write PNG or BMP images.

The output of "flatten pixmap" ca be displayed in a front panel picture indicator using "Draw flattened pixmap".

(See attached example (LabVIEW 7.1).
Message 2 of 6
(16,182 Views)

Hi,

I am trying to do something similar. I am collecting voltage data that ranges from 0-10V and creating a 2d array. How do I convert the data to get a jpeg version of the data in greyscale?

0 Kudos
Message 3 of 6
(16,051 Views)

Is there something wrong with the above example?  It shows how to take a 2D array of data and save it as a grey scale picture.

Can you clearify your question, or what you need above and beyond the example?  If your code is really small and simple you cna attach it so that we can see how you are trying to do the above

0 Kudos
Message 4 of 6
(16,039 Views)
My problem is that if I take my 2d array ( the numbers will be from zero to 10), and insert it into the unsigned 8-bit array on the example, the picture I get is all black. Please excuse my ingnorance, but I have never used the graphics vi's, and I am a bit confused. Thanks.
0 Kudos
Message 5 of 6
(16,030 Views)
Gotcha... I think you are close.  Take your 2D array and rather than going direct to the U8.send it through the multiplication by 128.  I did that and the 2D array of values from 0-10 went from a black image to a nice gray scale image.
 
If not can you attach a sample of your data so we can all run them through until we get a nice image for you.
0 Kudos
Message 6 of 6
(16,025 Views)