Thresholded Image Looks Black Using Vision Programs

Updated Oct 18, 2022

Reported In

Software

  • LabVIEW
  • Vision Development Module
  • Vision Assistant

Issue Details

  • Using the automatic threshold functions from the LabVIEW Vision palette result in a black image on my front panel image display. 
  • When I open my thresholded image in Vision Assistant or Paint, it appears to be all black.

Solution

LabVIEW 

The palette settings on the front panel need to be changed from the default greyscale to binary to view the image.
  1. Right click on the image display on the front panel. 
  2. Select Palette >> Binary

Vision Assistant

The image palette needs to be changed to the Binary imaging palette to view the image, as shown in the image below. 
 


Paint or Other Third Party Program 

There are two options to view the image in a third party program: 
  1. Change the palette in the third party program, similar to the example shown in Vision Assistant. 
  2. Change the actual pixel values to contain more contrasting values in LabVIEW before opening in the third party program. 
  • IMAQ Threshold.vi and IMAQ AutoB Threshold 2.vi have an input called Replace Value
  • Wire a value of 255 to the Replace Value input so all pixels with a value of 1 will be replaced with 255 to increase contrast. 

 

    Additional Information

    When a thresholded image is saved, each pixel value is written to the file as an 8 bit value of 0 or 1 by default. Because a greyscale palette ranges from 0 (black) to 255 (white), a binary image with only values of 0 and 1 does not have enough contrast and displays as virtually all black to the viewer.

    The red color that was originally seen in the binary image before it was written to disk was intentional to make the pixels with 1 values more distinctive from pixels with 0 values.