Documentation of 'boofcv.alg.filter.binary.impl.ThresholdSauvola' Java class
ThresholdSauvola
boofcv.alg.filter.binary.impl

Class ThresholdSauvola



  • public class ThresholdSauvola
    extends java.lang.Object

    Intended for use as a preprocessing step in OCR it computes a binary image from an input gray image. It's an adaptive algorithm and uses the local mean and standard deviation, as is shown in the equation below:
    T(x,y) = m(x,y) * [ 1 + k * (s(x,y)/R - 1)]
    where T(x,y) is the pixel's threshold, m(x,y) is the local mean, s(x,y) is the local deviation, R is dynamic range of standard deviation, and k is a user specified threshold.

    There are two tuning parameters 'k' a positive number and the the 'radius' of the local region. Recommended values are k=0.3 and radius=15. These were found by tuning against a set of text.

    • Constructor Summary

      Constructors 
      Constructor and Description
      ThresholdSauvola(int radius, float k, boolean down)
      Configures the algorithm.
    • Constructor Detail

      • ThresholdSauvola

        public ThresholdSauvola(int radius,
                                float k,
                                boolean down)
        Configures the algorithm.
        Parameters:
        radius - size of local radius. Try 15
        k - User specified threshold adjustment factor. Must be positive. Try 0.3
        down - Threshold down or up
    • Method Detail

      • process

        public void process(GrayF32 input,
                            GrayU8 output)
        Converts the input image into a binary image.
        Parameters:
        input - Input image. Not modified.
        output - Output binary image. Modified.
      • getK

        public float getK()
      • setK

        public void setK(float k)
      • getRadius

        public int getRadius()
      • setRadius

        public void setRadius(int radius)
      • isDown

        public boolean isDown()
      • setDown

        public void setDown(boolean down)

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.