IMAQ Merge Overlay VI Produces a Black Image in LabVIEW

Updated Aug 21, 2023

Reported In

Software

  • LabVIEW

Driver

  • NI-IMAQ

Issue Details

I am trying to overlay some text on a U16 grayscale image using the IMAQ Overlay VI together with the IMAQ Merge Overlay VI. To accomplish this, I am converting my picture into an RGB image, making sure I am not losing any information, and passing that to the Overlay VIs. Nonetheless, after running the IMAQ Merge Overlay VI, reverting the RBG image back to U16 grayscale, and displaying the result in an Image Display indicator, I always get a black image. The overlayed text looks fine, but the picture is not visible.

Original vs Result.png
 

Solution

This behavior is expected and it is related to how the data is being displayed. The Image Display Indicator in LabVIEW is actually an 8-bit display. That means that if you wire in a 16-bit image, the indicator has to decide how to handle the 16-bit information. To visualize the expected image and determine how the display will map the 16-bit information into 8-bit you can follow the steps below:

1. Right-click on an Image Display and select the 16-Bit Display Mapping... option.
16_bit_Display.png
2. From the Conversion Method drop-down menu, select the method that allows you to get the best result, according to your application requirements. For example, you can take just the top or bottom 8-bits and display those, or you can map the 16-bit data onto a range of 0-255.
 
Conversion Method.png
After selecting the correct mapping method, you can verify that the resultant image with the overlayed text will be displayed correctly. 

resultant_image_16_bit mapped.png