LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Signed 16-bit image mapping help

Solved!
Go to solution

Hi,

 

I am having trouble understanding the 16-bit Image Mapping that Labview does. I am using a Flea3 USB camera configured for continuous Grab. I set the configuration of the camera for signed 16-bit image output, Mono 16.

 

First of all, why is the bit depth set to 0 automatically? If I set the image output to unsigned 16 bit, then the bit depth is 16.

 

Second, I thought that 16-bit image output would actually use the full range from -32768 (black) to +32767 (white), however, when inspecting the Histogram of the image, it seems it is only using the from 0 to ~+24000. Converting the image to an array I see no negative values. Why is that? Is it related to the 16-bit Mapping? I set the mapping to Full Dynamic. If I use Given range and select the full bit range, then the image looks noisier and very gray. The object I am trying to image is naturally very dark, so I was expecting to see negative values.

 

Thanks in advance.

0 Kudos
Message 1 of 3
(146 Views)
Solution
Accepted by topic author mwally12

First of all, why is the bit depth set to 0 automatically? If I set the image output to unsigned 16 bit, then the bit depth is 16.

See https://zone.ni.com/reference/en-XX/help/370281AG-01/imaqvision/imaq_image_bit_depth/

A bit depth of 0 will allow you to choose how to set your black and white point of your viewer. When set to 8 or 16 the black and white point are set to 0 and 255/65535 respectively. As far as I know it's not possible to set a bit depth of 16 for an I16 image, only for U16.

 

 


Second, I thought that 16-bit image output would actually use the full range from -32768 (black) to +32767 (white), however, when inspecting the Histogram of the image, it seems it is only using the from 0 to ~+24000. Converting the image to an array I see no negative values. Why is that? Is it related to the 16-bit Mapping? I set the mapping to Full Dynamic. If I use Given range and select the full bit range, then the image looks noisier and very gray. The object I am trying to image is naturally very dark, so I was expecting to see negative values.


All digital cameras that I know of will output non-signed (positive) values. Using an I16 image buffer will not change or remap this. The output range you are seeing is perfectly normal. Unless you are subtracting images you might as well use U16 to avoid confusion.

0 Kudos
Message 2 of 3
(98 Views)

Thanks Ramon!

 

Appreciate your response.

 

Indeed I am substracting images, but so I changed the image coming from the camera to U16 (so that it matches the output of the camera) and when doing subtraction I cast to I16 first.

 

Thanks again!

0 Kudos
Message 3 of 3
(73 Views)