Welcome to our Support Center

Local Threshold

Description

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

 

Input parameters

 

Image Src : class, type accepted U8 and I16.

Local Threshold Parameters : cluster,

Blocksize : integer, size of the window the VI uses when calculating a local threshold.
Niblack/Sauvola Deviation Factor : float,
specifies the k constant used in the Niblack and Sauvola local thresholding algorithms, which determines the weight applied to the variance calculation. 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 VI because will not calculate the variance for any of the pixels. The function ignores this value if Method is not set to Niblack or Sauvola.
Method : enum,
specifies the local thresholding algorithm the function uses.

      • NIBLACK : computes thresholds for each pixel based on its local statistics using the Niblack local thresholding algorithm
      • BACKGROUND_CORRECTION : performs background correction to eliminate non-uniform lighting effects and then performs thresholding using the interclass variance thresholding algorithm
      • SAUVOLA : 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 : computes thresholds for each pixel based on its local statistics and the mean deviation, using the Modified Sauvola local thresholding algorithm

Look For : enum, indicates the type of objects for which you want to look.

      • Bright Objects : looks for objects in the image represented by pixels with values greater than the value computed by the threshold method
      • Dark Objects : looks for objects in the image represented by pixels with values less than the value computed by the threshold method

Background Correction Factor : float, is a correction factor used only in the background correction method.
Sauvola Deviation Range : float,
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 function ignores this value if Method is not set to Sauvola.
Replace Value : integer,
specifies the replacement value the VI uses for the pixels of the kept objects in the destination image.

Output parameters

 

Image Dst : class

Example

All these exemples are snippets PNG, you can drop these Snippet onto the block diagram and get the depicted code added to your VI (Do not forget to install TIGR library to run it).

Table of Contents