8.4.4 Adaptive Threshold

The filter is used in case the threshold transformation is used ineffectively and transforms semi-hue image to the binary one. In that case the threshold used for each pixel turns out to be dependent on characteristics of sub-area of the image containing this pixel.
Filter parameters:

  • New value (newValue);
  • Block size (blockSize);
  • TreshValue (treshValue);
  • Operations (treshOperation).

The filter writes to the pixel New value (newValue) in case if its brightness exceeds the average brightness in radius of the circle, indicated by the Block size (blockSize) parameter. Block size is a size of the analyzed area around the pixel which is used in order to calculate threshold values for a pixel: 3, 5, 7 and so on. The more is this value, the less is the sensitivity of the filter, the more noise is eliminated, yet, some details can be lost. The more is the Threshold value parameter (treshValue), the brighter objects shall be defined in the image.
Adaptive Threshold
In threshold transformation you can select one of the Operations (treshOperation):
1) binary transformation (treshBinary). Pixel whose value is higher than the threshold becomes white, lower — black.

2) Inverse binary transformation (treshBinaryInv). Pixel whose value is higher than that of the threshold becomes black, lower — white.
Please find more information on settings and the use of filter in the step by step instruction Tutorial on the use of Adaptive Threshold filter.