Skip to content

Auto Thresholding vTool#

The Auto Thresholding vTool allows you to segment images with a binary gray value distribution.

The Auto Thresholding vTool segments the input image into a region that contains either light or dark pixels. As no further parameters have to be set, Auto Thresholding is a simple to use segmentation method.

The Auto Thresholding vTool accepts an image via the Image input pin and outputs a single region via the Region output pin.

If you use the ROI Creator vTool to specify a region of interest before thresholding, the Auto Thresholding vTool accepts the ROI data via its Roi input pin. In that case, thresholding is only performed on the region of interest. Also, the histogram used for thresholding is based only to the region of interest.

The Region output of the Auto Thresholding vTool can also be used as Roi input for vTools with a Roi input pin. For more information, see the ROI Creator vTool topic.

Auto Thresholding vTool

How It Works#

Auto Thresholding works best on images with a binary gray value distribution that results in two prominent peaks in the histogram.

Below is a typical input image for Auto Thresholding:

Auto Thresholding Input Image

The corresponding histogram looks like this:

Auto Thresholding Histogram

You can see the two distinct accumulations of pixels. An internal algorithm determines the optimum threshold for separating the dark from the light pixels. The threshold will be placed somewhere in the middle between the two peaks in the histogram. In this example, the threshold is at a gray value of 107.

To configure the vTool, you just have to select whether you want the dark or the light pixels in your output region.

The following image shows the output region after the thresholding operation:

Auto Thresholding Segmentation Result

Configuring the vTool#

To configure the Auto Thresholding vTool:

Auto Thresholding vTool Settings

  1. In the Recipe Management pane in the vTool Settings area, click Open Settings or double-click the vTool.
    The Auto Thresholding Basic dialog opens.
  2. Select the desired polarity of the output region.

You can view the result of the thresholding in a pin data view. Here, you can select which outputs to display.



Accepts images directly from a Camera vTool or from a vTool that outputs images, e.g., the Image Format Converter vTool.

  • Data type: Image
  • Image format: 8-bit to 16-bit mono or color images. Color images are converted internally to mono images.


Accepts a region of interest from the ROI Creator vTool or any other vTool that outputs regions or rectangles. Multiple rectangles or regions are merged internally to form a single region of interest.

  • Data type: RectangleF, RectangleF Array, Region, Region Array



Returns a single region that includes all pixels of the polarity selected.

  • Data type: Region

Typical Predecessors#

Typical Successors#