Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving a tiff image from IMAQ

Hi All,

Whilst the IMAQ documentation states that images may be saved in a variety of formats including png and tiff, when I go to save the only option that I have is png. Is this a problem that anyone else has encountered, and if so how did you solve it?
0 Kudos
Message 1 of 6
(3,980 Views)
My first question is how many bits is your camera using? If it is 16 bits, the only format available is PNG. If it is 8 bits, you should have all the options available.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 6
(3,980 Views)
Hi Bruce,

Thanks for the reply. Our camera is 10-bit, and is not a "standard" camera (its the development kit for a particular CMOS imaging chip). This goes a long way to explaining what is happening.
Message 3 of 6
(3,980 Views)
Any image greater than 8 bits is converted to 16 bits, so that explains the problem.

I can also warn you that the 16 bit PNG file saved by IMAQ doesn't work well with most other (non-NI) programs. I think the byte order is reversed or something, because the images never look quite right.

If you are using LabVIEW and the Vision toolkit, you can easily convert the image to 8 bit and save it in any format you like.

Bruce
Bruce Ammons
Ammons Engineering
Message 4 of 6
(3,980 Views)
Bruce and Rodney,

Bruce is correct in this regard. I just wanted to point out the way in which we do the bits versus other applications. If you save a 10-bit image as a 16-bit image (which is what happens), we take your ten bits and pad the six zeros on in the most significant bits' location. Ex: If your pixel value is 11 0101 1101 in 10-bit, we'd save as 0000 0011 0101 1101 in 16-bit. Essentially, this maintains the same binary value. The problem is when other applications, such as Paint, etc., look at a 16-bit image. They only can display 8 bits. So, they look to the 8 most significant bits. In this case, they would take 0000 0011, which, on a 256-level grayscale, is essentially black. What you'd need to do is somehow bit-shift your 10 bits over si
x spots so that Paint will look at 1101 0111 and you'll have a better representation of your image.

Best of luck with everything,

Jim Laudie
Applications Engineer, National Instruments
Message 5 of 6
(3,980 Views)
Hi Bruce Rodney and Jim,
Jim is correct in the regards of opening 16bit images with PaintShop pro, This kind of program converting the image to 8 bit. So you have to do bit shift ofthe image.
But you can save 16bit Tiff images with IMAQ Vision and open them with Matlab for example.
I am doing that all the time. No problem.

Note: BMP will not work only Tiff can handle 16bit.

Amit,
Message 6 of 6
(3,980 Views)