01-15-2012 12:25 PM
I have a 12bit camera and am using the Snap in IMAQ to acquire an image. When I have an indicator type of variable as an output and I look at the image (the variable is an image in the front panel) it shows the image very nicely. Also when going over the pixels with the cursor gives correct greylevel values. When I connect the wire that is connected to the image variable as the input for the IMAQ save image to file vi (part of IMAQ), and saves the image as png (so to maintain the bitdepth) it saves it as 16bit image. Then when I open the files the greylevels do not match what was originally there. I thought it was just a matter of dividing by 16 (16bit ->12bit) but that does not help. For white images this conversion works fine, but for dark images I still get 2 orders of magnitude between the greylevels of the original images and the saved images (12 greylevels in the original compared with 1500 greylevels in the saved). This does not make any sense to me.
1. Is there a way to do a proper conversion - what would be the formula?
2. What do I need to do to make sure this does not happen - how can I save the file that I am viewing?
01-16-2012 02:31 PM
Let's try it the opposite way, as I do not see where your problem comes from.
Does this snippet work fine and display the correct color values on your PC? I have placed a screenshot of the image window contents on the block diagram.