Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Using B&W tif images with unsigned 16-bits

Hello all,
 
I need to analyze images that are stored in 16-bit tiff format. When I use IMAQ to read the image it's 16-bit SIGNED.
I need the image to be in UNSIGNED format (0-65K), and I do not want to downsample to 8-bits (I need to quantitate many ROIs in my image, and the image has values ranging from 0 to 50K.)
 
Thanks in advance!
 
Chandran
 
 
0 Kudos
Message 1 of 10
(6,705 Views)

Hi Chandran,

Have you tried using the "File Options" cluster input on "IMAQ ReadFile" ?

-Prashant
0 Kudos
Message 2 of 10
(6,693 Views)

Hi Prashant,

Yes I tired that, but it seems that the IMAQ create vi that is called before IMAQ ReadFIle overrides the "File Options" cluster.

When I call the IMAW create vi, the file type is set to I16. I get pixel values from -32768 to 32767.

I tried setting the IMAQ REadFIle options to set the min to 0 and max to 65535, but this didn't change anything.

Thanks for your reply, I'm still searching for a solution.

 

-Chandran

0 Kudos
Message 3 of 10
(6,683 Views)
Chandran,

have a look on the Vision Concept Manual, linked below:
http://www.ni.com/pdf/manuals/372916e.pdf

Chapter 1 describes the problematic with I16...

Best Regards,
ThSa
Message 4 of 10
(6,670 Views)

Hey Chandran,

I would recommend that you check out the following discussion forum called 16-bit greyscale colormap. One of the posts on that thread has an example VI, but you might want to double check to make sure that it does what you want.

Regards,
DJ L.

Message 5 of 10
(6,653 Views)
Thanks for all your input. I think I am just a bit confused with a B&W 16 bit TIFF format.
UNSIGNED INT gives a dynamic range from 0 to 65K.
Is SIGNED INT simply just -32K to +32K (i.e., 0, 32K, 65K maps to -32K, 0, +32K)??
 
Chandran
0 Kudos
Message 6 of 10
(6,615 Views)
Hey Chandran,
 
You are correct in that both have that 65K range, and that the signed and unsigned 16 bit are just mapped differently. You are correct in that (I16 or Signed 16 bit) 0, 32K, 65K can be mapped to (U16 or Unsigned 16 bit) -32K, 0, +32K. The Example program that David posted in the thread I mentioned above demonstrates that a 16 bit unsigned image can be mapped to the signed 16 bit range so that the Vision functions and the image display can use it. The TIFF format can save either.
 
I hope this helps. Let us know if you have further questions or concerns. Thanks, and have a good one.

Regards,
DJ L.
0 Kudos
Message 7 of 10
(6,589 Views)
I can't Get the IMAQ READFILE options to set the min to 0 and max to 2.5 on a Real32 Image.  It seems to me that the IMAQ READFILE Options has a problem.  Can anyone confirm this?  I also set the Use Optional Values Parameter, but nothing seems to happen to the image.
Ben Yeske
0 Kudos
Message 8 of 10
(6,018 Views)
Hi Monzue,

Which version of LabVIEW are you using?  Which version of the Vision Acquisition Software do you have?

When you say that the IMAQ ReadFile won't let you set the min and max values, are you getting errors on runtime or when you are physically changing the values?  Can I get a screenshot of your code?

Regards,
Rishi L
National Instruments
Applications Engineer
0 Kudos
Message 9 of 10
(5,997 Views)
why even use integer? why not just use 32 or 64-bit floats and crunch away?

you can compile screaming image processing code on modern processors to chew through float point calcs.
0 Kudos
Message 10 of 10
(5,905 Views)