Table Of Contents

Threshold (Local Threshold) (G Dataflow)

Last Modified: June 25, 2019

Thresholds an image into a binary image based on the specified local adaptive thresholding method.

connector_pane_image
datatype_icon

replace value

Replacement value the node uses for the pixels of the kept objects in the destination image.

datatype_icon

look for

Type of objects to look for.

The following values are valid:

Name Value Description
Bright Objects 0

Looks for objects in the image represented by pixels with values greater than the value computed by the threshold method.

Dark Objects 1

Looks for objects in the image represented by pixels with values less than the value computed by the threshold method.

datatype_icon

image src

Reference to the source image.

datatype_icon

image dst

Reference to the destination image.

datatype_icon

window size

Cluster specifying the size of the window the node uses when calculating a local threshold.

The window should be sized as large as possible, but small enough that each window contains pixels with consistent levels of contrast. The node will produce inconsistent results for windows that contain uniform pixel values. A typical window should be about the size of the object you want to segment in the image.

datatype_icon

sizeX

Size of the window in the x dimension.

The size must be at least 3 and cannot be larger than the width of image in.

datatype_icon

sizeY

Size of the window in the y dimension.

The size must be at least 3 and cannot be larger than the height of image in.

datatype_icon

method

Local thresholding algorithm the node uses.

The following values are valid:

Name Value Description
Niblack 0

Computes thresholds for each pixel based on its local statistics using the Niblack local thresholding algorithm.

Background Correction 1

Performs background correction to eliminate non-uniform lighting effects and then performs thresholding using the interclass variance thresholding algorithm.

Sauvola 2

Computes thresholds for each pixel based on its local statistics and also uses the global standard deviation, using the Sauvola local thresholding algorithm.

Modified Sauvola 3

Computes thresholds for each pixel based on its local statistics and the mean deviation, using the Modified Sauvola local thresholding algorithm.

Default: Niblack

datatype_icon

error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

Niblack/Sauvola deviation factor

Input that specifies the k constant used in the Niblack and Sauvola local thresholding algorithms, which determines the weight applied to the variance calculation.

Valid k constants range from 0 to 1. The lower the deviation factor, the closer the pixel value must be to the mean value to be selected as part of a particle. Setting the Niblack/Sauvola deviation factor to 0 will increase the performance of the node because the node will not calculate the variance for any of the pixels. The node ignores this value if method is not set to Niblack or Sauvola.

datatype_icon

Sauvola deviation range

Input that specifies the R constant used in the Sauvola local thresholding algorithm. The Sauvola deviation range and the Niblack/Sauvola deviation factor both determine the threshold calculation. The Sauvola deviation range is used to obtain better noise control in the thresholded image.

The deviation range is equivalent to the dynamic range of the standard deviation of the image. Valid R constants depend on the bit depth of the image. For 8-bit images, the range is 1 to 255. For 16-bit images, the range is 1 to 65535. The node ignores this value if method is not set to Sauvola.

datatype_icon

image dst out

Reference to the destination image.

If image dst is connected, image dst out is the same as image dst. Otherwise, image dst out refers to the image referenced by image src.

datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics