The filter picks out objects from the surrounding background when brightnesses objects and background pixels are concentrated near two prevailing values. Usually the filter is used for receiving two-grade (binary, black and white) image of half-tone image or deleting the noise.
Marking of objects is done by means of defining the values of threshold dividing the areas of brightnesses distribution. If the brightness value of a defined pixel is more than the threshold pixel, than this point belongs to the object, if less — than to the background.
The filter writes to the pixel New value (newValue) in the case if its brightness is higher than the average brightness in radius of the circle defined by the Block size (blockSize) parameter. New value should not equal zero.
Block size is a size of the analyzed area around the pixel. The more is this value, the less the sensitivity of the filter, the more noise is eliminated, yet, some details can be lost. The more is the TreshValue (treshValue) parameter, the brighter objects shall be defined at the image.
Selection of Block size and Threshold value values cannot be universal, it changes from task to task, and these tasks should be picked by hand for receiving the best result.
In threshold transformation you can select one of the Operations (treshOperation):
1) binary transformation (treshBinary). Pixel whose value is higher than that of a threshold becomes white, lower — black.
2) inverse binary transformation (treshBinaryInv). Pixel whose value is higher than the threshold becomes black, lower — white.
3) reduced (treshTrunc).
4) set to zero (treshToZero): Pixel value less than the threshold equals 0, higher than the threshold stays the same.
5) inverse, set to zero (treshToZeroInv). Pixel value higher than the threshold equals to 0, less than the threshold stays the same.
Please find more information on settings and the use of filter in the step by step instruction Tutorial on the use of Threshold filter.