11-14-2005 10:52 AM
I created an example (GenerateTiff.vi) which generates an U16 2-D array. The array starts at 0 and gradually increases to 35532. I then use the array to image function and save this image as a tiff file.
If this image is viewed as an U16, it would be a line that changes from black to white. When viewed as an I16, the image would go from gray to white and then black to gray. This is why we need the U16->I16 converter.
In ReadTif.vi, we read the tiff file, convert the image to an array, manipulate the numbers, build the array to an image, and display this to the user. The ReadTif.vi shows a corrected and uncorrected image.
As far as your image being [0, 32767], this doesn't make any sense. If your image scales the full range of an U16, it should have values from 0 to 65,535. LabVIEW just reads these values. Granted reading the values as a I16 would give the range of -32768 to 32767, but the values would not be restricted to [0, 32767]. Hopefully this example will shine some light on the cause of this problem, because the example does not exhibit the behavior you are describing.
Regards,
Ryan M.
Applications Engineer
National Instruments
11-14-2005 02:57 PM
Hi Ryan, thanks again for your response.
Attached is a jpg of the block diagram for my vi. I also pasted the indicator cluster from the IMAQ Histogram.vi showing the min and max values from my image.
The main difference from your example to mine is that I am reading in a color image. LabVIEW identifies it as a RGB (U64).
I agree completely with your statement that it doesn't make sense that the image is [0,32767]. This is why I am so puzzled.
Maybe you can see something that I am doing wrong from my block diagram.
Thanks
11-15-2005 06:20 PM
As we have been discussing, LabVIEW represents Images as an I16. When the image is loaded from file, you have U64; however, when the IMAQ Extract Color Planes is called the U16 color planes must be converted to I16 color planes. This is done by converting all values larger than 32767 to 0. Because of this, your histogram displays values from 0 to 32,767. In order to avoid this, you could read the tiff file using the native Read File command. By correctly parsing the data, you could generate an array of each color plane. Once we have this data, we can run the U16->I16 conversion.vi and then the color planes would be properly represented. I wish I could give you an example of this, but unfortunately I am not aware of any examples that do this.
Regards,
Ryan M.
Applications Engineer
National Instruments