Working with 16-Bit ImagesCognex VisionPro

Some vision applications require the use of images that contain more than 8 bits of data per pixel to make full use of sensor accuracy. For example, thermal images and x-ray images can require more than 8 bits per pixel to accurately store information about the object under inspection. Other vision applications require more than 8 bits per pixel to compensate for the low contrast images the application will acquire, as shown in the following example:

Acquisition General Theory 16 Bit Images Low Contrast

VisionPro supports the acquisition of greyscale images with more than 8 bits of image data per pixel, up to a maximum of 16 bits. These images can then be analyzed with vision tools that support 16-bit images or they can be reduced to 8-bit images for analysis by any vision tool that VisionPro supports.

16-Bit Image Acquisition

VisionPro supports 16-bit encoded image acquisition for greyscale images, meaning the images you acquire can occupy up to 16 bits per pixel regardless of how many bits the image actually uses. 10-bit, 12-bit and 14-bit images are stored using 16-bits per pixel.

VisionPro supports a variety of cameras that acquire 16-bit images. See the topic About this Release for new cameras supported as of this release, or see the supported cameras list for all the cameras this release supports.

In QuickBuild, the Image Source control and the CogAcqFifo edit control will both accept images from 16-bit cameras and output 16-bit greyscale images for analysis by the other vision tools in your application. In addition, the Image File tool will also accept single images or image-database files of 16-bit images.

16-bit images can be used with a CogFixture or CogFixtureNPointToNPoint tool to define a new coordinate space, and they can be used by a CogCalibNPointToNPoint tool to define a calibrated coordinate space.

Programmatically, use the CogImage16Grey class to store 16-bit greyscale images for your Microsoft Visual Studio applications.

16-Bit Image Processing

The following tools can work with 16-bit images:

All other vision tools can only accept 8-bit images, so you must convert the 16-bit images your application acquires into 8-bit images using the Pixel Map tool, which accepts 8-bit or 16-bit images and performs a choice of mapping functions based on the settings you configure. See the topic on Pixel Map Tool for details on how to use the Pixel Map tool.

Displaying 16-Bit Images

While VisionPro can acquire 16-bit encoded images, it can display only the three planes of 8-bit RGB values. For 8-bit greyscale images, the settings for Red, Green and Blue are set to identical values to represent the grey value of each pixel. For images with a bit depth greater than 8-bits, the CogDisplay object that VisionPro uses to display images and graphics performs a mapping function between image values and RGB values. For example, a 10-bit image has 1024 potential grey values, so four grey values in the input image are mapped to one of the 256 grey values in the output image (1024/256 = 4). VisionPro performs the mapping in such a way that the displayed image retains the dark and bright characteristics of the original 16-bit encoded image.

The CogDisplay object uses a default lookup table to perform the mapping between the 16-bit encoded image and the display image, but you can access the lookup table programmatically and assign your own mapping between the input image and displayed image. See the method SetImage16GreyColorMap SetImage16GreyColorMap for more information.

You can also use the Colormap control to zoom into greyscale ranges.