Clamp and Edge Detection Functions Don't Work on Binary Images

Updated May 30, 2018

Reported In


  • Vision Assistant
  • Vision Development Module
  • Vision Builder for Automated Inspection
  • LabVIEW Full
  • LabVIEW Professional

Issue Details

I am using the Clamp function (or another function that relies on edge detection) on a binary image in Vision Assistant, Vision Builder, or LabVIEW. I am getting a measurement of 0 with the Clamp function, or I am unable to detect edges.


This behavior occurs because binary images have a contrast of 1 pixel, which makes edge detection difficult in an algorithm built for U8 images. There are a few ways to improve this behavior:
  • Make sure the "Contrast" or "Minimum Edge Strength" parameter for your function is set to 1.
  • Increase the contrast on the image by multiplying all of the pixel values by a larger number.

Additional Information

On a grayscale image, these parameters are used to determine how strong an edge needs to be in order to be detected. If you set it to 40, an edge will be detected between regions if their pixels have values of 20 and 60, but not 20 and 59.

A binary image's pixels can only have values of 0 and 1, so you need to set the contrast parameter to 1 in order to detect any edges.


Not Helpful