Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

saving monochrome images as 10 bit uncompressed

I have been trying to save 10 bit depth images as uncompressed from a PCI-1409 frame grabber. In MAX i set them up as 10 bit. In LabVIEW 6.1 using Vision 6 i realise i have to set up as 16 bit. It doesn't allow me to save as .bmp therefore i save as lossless compressed .png, but these images are just black. Has anyone come across this before?
0 Kudos
Message 1 of 3
(3,658 Views)
Hello,

I think this is a normal behavior,10-bit grayscale images are stored in the
IMAQ 16-bit grayscale type(with only 10-bit used), and bmp file format
doesn't support the16-bit grayscale type, whereas png does.

Moreover, video adapters doesn't support 16-bit grayscale too, in order to
display these images correctly, you should use the 16-bit display mapping
functions of IMAQ Vision, (see "IMAQ WindDisplayMapping.vi" in the display
menu).

You should use the "full dynamic" conversion policy , or the "downshifts"
conversion policy with 2 shifts.

Best Regards.
Jean-Christophe.


"FraserD" wrote in message
news:5065000000080000007CA70000-1042324653000@exchange.ni.com...
> I have been trying to save 10 bit depth images as uncompressed fro
m a
> PCI-1409 frame grabber. In MAX i set them up as 10 bit. In LabVIEW 6.1
> using Vision 6 i realise i have to set up as 16 bit. It doesn't allow
> me to save as .bmp therefore i save as lossless compressed .png, but
> these images are just black. Has anyone come across this before?
0 Kudos
Message 2 of 3
(3,657 Views)
The reason you only see black images in many image viewers (including the one that comes for free with windows) is that the viewers do not support 16-bit images. As Jean-Christophe mentioned, the 10-bit images are stored as 16bit images with the highest order bits padded with zeros. When an image viewer that does not support 16-bit images opens up the image, it only displays the highest 8 bits, which in this case is six zeros folowed by the upper 2 bits of your actual image. This will often look black because with only 2 bits you can only get color values of 0, 1, 2, and 3 out of 256 grayscales. You have a few options to get around this problem.

1) The easiest is what is suggested above- using LabVIEW to display the image.

2) Before saving the images
, bitshift them to the left by 6 bits. This will make the 8 bits displayed by most viewers the most signifigant bits of your image.

3) Use a higher quality viewer. I believe a commercial product like photoshop will interpret the 16bit images correctly.

4) Truncate your image to 8 bits before saving.

Hope this helps clarify things a bit. Good Luck!!

Dustin
0 Kudos
Message 3 of 3
(3,657 Views)