Thresholding with flows

From Endrov


Thresholding is one of the most useful operations in detecting objects. A mask is created, consisting of 0 and 1, depending on the original intensity. Hence to see the mask you need to crank up the contrast in the viewer! The difference between algorithms lies in the calculation of the cut-off value.

If you want to manually choose a threshold value then use the logical operator (>) instead. It works very well in many cases.

Operations act in 2D


Contents

Fukunaga

A generalization of otsu thresholding to multiple classes. Use 2 for Otsu thresholding

Complexity O(#pixels^(numberOfClasses-1)+numColorUsed*log(numColorUsed))

Otsu

See Fukunaga

Percentile

Use a percentile of the histogram as the cut-off Complexity O(#pixels)

Max entropy

Splits into 2 classes based on histogram entropy

Complexity O(#pixels+numColorUsed*log(numColorUsed))

Input preprocessor: Quantize

If your input image has too many colors for the algorithm to run smoothly, use this unit to reduce to the given number of colors.