09-01-2010 02:48 PM
Hi,
I am writing a simple imaging demonstration for an Infrared Solutions IR-160 imaging camera.I do not have IMAQ and unfortunately, there are no funds available at this point. (If the demo is successful, funds might become available.) I have LV 8.5.1, full edition.
The camera creates 16 bit grayscale images, but the image format is not well documented. I know that the image is 160 pixels wide x 120 pixels high, that the gray values are stored as plain bytes (not ASCII), and that the data format is 16 bit signed words, most significant byte first.
I attach two sample images (8 bit and 16 bit) and two test vis.
I am able to read the image, but instead of grayscale, everything is blue, and there are artifacts across the top of the image.
The camera also creates 8 bit images in pgm format, but I have the same issues there. (The pgm image opens fine in e.g., corel paintshop pro.).
What do I need to do to make the image appear in grayscale, and save it as a bitmap?
Thank you for your help.
Peter
Solved! Go to Solution.
09-01-2010 03:56 PM - edited 09-01-2010 03:57 PM
Your fundamental problem was using the grayscale data as rgb data. For grayscale r=g=b=0-255.
You can simply scale the image to a 8-bit grayscale image and then save to BMP format if you so choose (I prefer PNG).
I assume the picture is right (orientation-wise), did not have a program on this machine to look at the other image. You can re-wire this example to open a file since I just use default data, change the contrast using the cursors, then save to BMP.
09-01-2010 04:24 PM
Hi Darin, Thank you very much for your fast reply.
09-01-2010 04:26 PM
However, I would like to keep the full 16bit data depth. How am I gonna do this? Thanks.
09-01-2010 04:29 PM
Also, I need the vi in LV 8.5.1, not LV9. Thanks again. Peter
09-01-2010 04:44 PM
Here is the LV8.5 Version.
What do you want to do with this image? Fix it for export to some other viewer, manipulate it in LV, or both?
09-01-2010 04:49 PM
I would like to manipulate it in LabVIEW. I need to subtract one image file (background) from another image file (sample), then I would like to export it to some other viewer in a standard imaging format. Thanks,.
09-03-2010 06:00 AM
HI Paul,
It looks like Darin may have included the ability to save. In order to manipulate the image, you're going to have to go into the image cluster and manipulate the array of points from there. In the case of subtracting one image from another, you'd be loading two images of the same size and looping through the arrays in the image clusters and subtracting the values from one from the other.
09-14-2010 06:52 PM
Sorry for the delay. I was out of town. My earlier question how to display the data in full 16 bit depth was not yet addressed. The example vi provided by Darin converts the data into 8bit for display.
Thanks everybody for your continuing help.
Peter
09-15-2010 12:29 PM
Hi Peter,
The picture control is only going to be capable of displaying an 8-bit grayscale image. However, you can still work with and manipulate the image in 16-bits. It looks like your initial VI was already able to read the data in 16-bit. You'll just need to apply the manipulations to the array. Then when you want to display, you can convert to 8-bit and display the image. Something to note about that: most monitors will only use 8-bits per component or color. Since all three color components need to have the same value for grayscale, there's effectively only 8-bits available for display of a grayscale image.