Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make IMAQ ReadFile to read 12-bit depth image?

Hello,

 

I have Image Pro softwore from other branch that produced lot of 12-bit per pixel images with 4,096 intensity level in *.TIF format. I couldn't figure out how to make IMAQ ReadFile to read those 12-bit images grayscale properly without the need of conversion. I kept getting those images distorted via IMAQ readfile. I had to convert Image Pro images from 12 bit to 8 bit per pixel to be able to read it clearly but it loses the precision of the intensity from 4,096 to 256 levels. Can you please help me how to enable IMAQ ReadFile or other tool to be able to read 12-bit per pixel directly? I even tried to use Window Picture Viewer or Paint or whatever and they all couldn't read 12-bit per pixel images and I kept getting error message, "Drawing failed". 

 

Thanks.

0 Kudos
Message 1 of 7
(4,666 Views)
Have you tried setting the image type to 'Grayscale (U16)' with the IMAQ Create function that creates the image buffer that is wired into IMAQ Read File? If not, please try this out.  If this does not work, you can post your image on this thread.
Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 2 of 7
(4,637 Views)

Yeah. I tried those options including Grayscale U16. Some options either gave "incompatible" or just displayed distorted version and RGB(U64) only displayed black in both 8- and 12-bit image versions.. I tried to upload images here but your uploader software doesn't support *.TIF images. It only supports JPEG, GIF and PNG so I simply renamed those images from .TIF to .JPEG. Result is same thing.  I tried to upload 12-bit .JPEG image version but your uploader still won't accept it simply cuz my image is too large (2,171k) and your uploader max file size is 1000k. I can reduce 12-bit image size but that ruins the original purpose of preserving the original, unaltered images generated from Image Pro software that other branch used. I try not to convert them due to thousands of images they stored over years. They need 4,096 intensity levels not 256..  I just wanted labview to have ability to read those images directly with simple algorithm that I can do easily with generic images. I could send you private email via my gmail for those images instead..

 

By the way, Image pro has line profile that generated 4,096 intensity levels directly from those 12-bit TIF images. I had to convert 12-bit image to 8-bit image TIF so LabVIEW line profile could read it and only generated 256 intensity levels instead that I find it unacceptable due to reduced precision.

 

Thanks.

 

 

0 Kudos
Message 3 of 7
(4,621 Views)
It is definitely possible to reatd 12-bit images in LabVIEW. I will have to check if there are any known issues with reading certain types of 12-bit TIF files. I will let you know what I find out.
Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 4 of 7
(4,585 Views)

From what I could find it, it looks like the format of the TIF image you have is proprietary, especially considering you cannot open this with other programs. The following thread deals with a similar problem: http://forums.ni.com/ni/board/message?board.id=200&message.id=3645&requireLogin=False . It is hard to say what exactly is happening without testing a sample image that you have.

 

If you would like further assistance on this issue, I would recommend creating a service request with us at http://www.ni.com/support. You can send us a sample image through this service request. 

Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 5 of 7
(4,537 Views)
Yes, I just submitted the service request including my 12-bit image attached and it went through. I am looking forward to see it solved.. Thanks. 😉
0 Kudos
Message 6 of 7
(4,527 Views)

I am having a similar problem reading a 16-bit unsigned TIF file. Were you ever able to read your 12-bit TIF? If so, how did you do it?

0 Kudos
Message 7 of 7
(4,185 Views)