LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Store a 12-bit gray scale image

I'm using a video camera to acquire images. This camera delivers 12-bit gray scale images so 4096 levels of grey. However, when I store these images on my HD on PNG format, the maximum value of a pixel is 256. Which is normal because the 3 colors R, V, B are coded onto 8 bits each. How is it possible to keep the signal dynamic of the image delivered by the camera? Does it exist an image format which would allow me to store the pixel values onto 12 bits ?
CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 1 of 18
(7,559 Views)

You can't use Write PNG File.vi.  It's for 8 bit gray scale or 32 bit RGB color.

For 12/16 bit gray scale, you should use IMAQ.

 

George Zou

http://gtoolbox.yeah.net

 

George Zou
Message 2 of 18
(7,544 Views)
Acutally, I'm using IMAQ. But I need to store these images on my Hard Drive and be able to share them. So I need a format that Windows XP can easily read. How can I do that ?
CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 3 of 18
(7,533 Views)
IMAQ support 16 bit gray scale.  What image type are you using?
Both PNG and TIFF support 16 gray scale.
 
 
George Zou
 
George Zou
Message 4 of 18
(7,524 Views)
There's always the last-resort solution, which is to save as a text file...  Not too good for sharing, but better than buying more software.
0 Kudos
Message 5 of 18
(7,521 Views)
I'm using the IMAQ function "IMAQ Write PNG file" to store the images. But then when you open these stored images with a basic software (such as Paint) each pixel is coded onto 256 levels. Do you think I should turn "Use bit depth?" option to True ?
CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 6 of 18
(7,504 Views)
If you just need to view the files, there are numerous free viewing utilities. Try http://www.irfanview.com/
It can display virtually any format you can think of!
0 Kudos
Message 7 of 18
(7,495 Views)
Indeed I need to display these images but I also have to view the value of each pixel on a 4096 gray scale and not on a scale of 256.
CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 8 of 18
(7,485 Views)

hi there

well, if you have IMAQ, why don't you write a little viewer in LabVIEW? The IMAQ display delivers built-in tools for viewing a pixels value.

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 9 of 18
(7,484 Views)
the problem isn't viewing the images; he can already do that well enough with the programs he's got!
 
The problem is the color (or in this case, greyscale) depth.  He's finding that the standard "output to PNG" function writes his 12-bit images as 8-bit images, which means data loss.
 
It seems that the outputted image is based on the "color palette" that you select... unfortunately it also seems that the only greyscale palette available limits you to 8 bpp... I'm not exactly a labview expert though, so I'd wait for someone with a cooler-looking rank thingy to confirm that.
Message 10 of 18
(7,467 Views)