List of all members.
Instead of the global thresholding performed for example by util::MatrixUtils::compare(), this class is able of adaptively changing the binarization threshold. The threshold is presented as a percentage of a local average. That is, if you set the threshold to 0.1, pixel values less than 10% of the local average are set to zero. If the threshold is one, everything below average is reset to zero.
The thresholding works in two modes: "pixel" and "block". In pixel mode, each pixel is thresholded based on the neighborhood around it. In block mode, each neighborhood is thresholded block-wise.
Static Public Methods
|template<class T> util::Matrix< T >||threshold (const util::Matrix< T > &mat, double threshold=1, bool pixelMode=false, int neighborhoodSize=16, bool setToOne=false)|
|Adaptively threshold an image. |
Adaptively threshold an image.