ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Can LabVIEW save a 16 bits image

Hi,
I want to save a 16 bits image using LabVIEW or Imaq. I realized that there were some discussions about this issue, i know that I can only save the 16 bits image in a tiff format. So, let's say i need to save the 16bits image in a tiff format and it seems that LabVIEW program can't do this but Imaq can. So, i use Imaq. I did a simple test, i create an 2D array has a size of 256*256, and the value in the array is between 0~65280. So, if I want to save this array as a image, i need to save them into a 16 bits, tiff format. I saved it using IMAQ Write TIFF file.vi. Then I opened the image file with ImageJ program, and I found the histogram is between 32768~65535, not 0~65280. I created another image again, with the value between 0~32640. Then I opened the image with ImageJ again, and i found the histogram is between 32768~65408, which are exact the value of 0~32640 add by 32768. As a matter of fact, I tried creating several images and found that when I saved them into 16 bits, tiff format by using IMAQ Write TIff file.vi, the bit depth always add by 32768.
 
So, is this the default setting of LabVIEW? Can I change it? How to save an array exactly to a 16 bits image, without adding another 32768 into its bit depth? besides, adding another 32768 bit depth means that i can only save an 15 bits array, not 16 bits, right?!
 
Best, Bo-Jui
0 Kudos
Message 1 of 3
(4,475 Views)
Bo-Jui -

Just as a side note, the AIPD, JPEG2000, PNG and TIFF formats all support writing an I16 image.

Unfortunately, as you've discovered, signed pixel formats such as I16 aren't always handled correctly/easily with other image editors.  The good news is that NI Vision 8.6, which should be released shortly, does contain support for Image Management functionality (which includes reading/writing to file) for unsigned 16-bit images, which will hopefully clear up the problems you've mentioned.

Greg Stoll
Vision R&D
National Instruments
Greg Stoll
LabVIEW R&D
0 Kudos
Message 2 of 3
(4,458 Views)

The good news is that NI Vision 8.6, which should be released shortly, does contain support for Image Management functionality (which includes reading/writing to file) for unsigned 16-bit images, which will hopefully clear up the problems you've mentioned.


That is one grt news .
Message 3 of 3
(4,456 Views)