The class binarize a grayvalue image. The segmentation algorithm is based on "Binarization of Historical Document Images Using Local Maximum and Minimum", Bolan Su, Shijian Lu and Chew Lim Tan, DAS 2010.  
 More...
#include <Binarization.h>
 | 
| cv::Mat  | compContrastImg (const cv::Mat &srcImg, const cv::Mat &mask) const  | 
|   | 
| cv::Mat  | compBinContrastImg (const cv::Mat &contrastImg) const  | 
|   | 
| virtual float  | contrastVal (const unsigned char *maxVal, const unsigned char *minVal) const  | 
|   | 
| virtual void  | calcFilterParams (int &filterS, int &Nm) | 
|   | 
| virtual float  | strokeWidth (const cv::Mat &contrastImg) const  | 
|   | 
| virtual float  | thresholdVal (float *mean, float *std) const  | 
|   | 
| void  | computeDistHist (const cv::Mat &src, QList< int > *maxDiffList, QList< float > *localIntensity) const  | 
|   | 
| void  | computeThrImg (const cv::Mat &grayImg32F, const cv::Mat &binContrast, cv::Mat &thresholdImg, cv::Mat &thresholdContrastPxImg) | 
|   | 
| bool  | checkInput () const override | 
|   | 
| QString  | debugName () const  | 
|   | 
The class binarize a grayvalue image. The segmentation algorithm is based on "Binarization of Historical Document Images Using Local Maximum and Minimum", Bolan Su, Shijian Lu and Chew Lim Tan, DAS 2010. 
- See also
 - Module
 
 
      
        
          | rdf::BaseBinarizationSu::BaseBinarizationSu  | 
          ( | 
          const cv::Mat &  | 
          img,  | 
        
        
           | 
           | 
          const cv::Mat &  | 
          mask = cv::Mat()  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Initializes a new instance of the BaseBinarizationSu class. 
- Parameters
 - 
  
    | img | The source img CV_8U. | 
    | mask | The optional mask image CV_8UC1. | 
  
   
 
 
      
        
          | cv::Mat rdf::BaseBinarizationSu::binaryImage  | 
          ( | 
           | ) | 
           const | 
        
      
 
Returns the binary image. 
- Returns
 - The binary image CV_8UC1.
 
 
 
  
  
      
        
          | void rdf::BaseBinarizationSu::calcFilterParams  | 
          ( | 
          int &  | 
          filterS,  | 
         
        
           | 
           | 
          int &  | 
          Nm  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inlineprotectedvirtual   | 
  
 
 
  
  
      
        
          | bool rdf::BaseBinarizationSu::checkInput  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
overrideprotectedvirtual   | 
  
 
checks if all input images are in the specified format. 
Implements rdf::Module.
 
 
  
  
      
        
          | cv::Mat rdf::BaseBinarizationSu::compBinContrastImg  | 
          ( | 
          const cv::Mat &  | 
          contrastImg | ) | 
           const | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | cv::Mat rdf::BaseBinarizationSu::compContrastImg  | 
          ( | 
          const cv::Mat &  | 
          srcImg,  | 
         
        
           | 
           | 
          const cv::Mat &  | 
          mask  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | bool rdf::BaseBinarizationSu::compute  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
overridevirtual   | 
  
 
 
  
  
      
        
          | void rdf::BaseBinarizationSu::computeDistHist  | 
          ( | 
          const cv::Mat &  | 
          src,  | 
         
        
           | 
           | 
          QList< int > *  | 
          maxDiffList,  | 
         
        
           | 
           | 
          QList< float > *  | 
          localIntensity  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | void rdf::BaseBinarizationSu::computeThrImg  | 
          ( | 
          const cv::Mat &  | 
          grayImg32F,  | 
         
        
           | 
           | 
          const cv::Mat &  | 
          binContrast,  | 
         
        
           | 
           | 
          cv::Mat &  | 
          thresholdImg,  | 
         
        
           | 
           | 
          cv::Mat &  | 
          thresholdContrastPxImg  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | float rdf::BaseBinarizationSu::contrastVal  | 
          ( | 
          const unsigned char *  | 
          maxVal,  | 
         
        
           | 
           | 
          const unsigned char *  | 
          minVal  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
inlineprotectedvirtual   | 
  
 
 
  
  
      
        
          | bool rdf::BaseBinarizationSu::isEmpty  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
overridevirtual   | 
  
 
Determines whether this instance is empty. 
- Returns
 - True if the source image is not set.
 
Implements rdf::Module.
 
 
      
        
          | void rdf::BaseBinarizationSu::setPreFiltering  | 
          ( | 
          bool  | 
          preFilter = true,  | 
        
        
           | 
           | 
          int  | 
          preFilterSize = 10  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Sets the preFiltering. All blobs smaller than preFilterSize are removed if preFilter is true. 
- Parameters
 - 
  
    | preFilter | if set to true [prefilter] is applied and all blobs smaller then preFilterSize are removed. | 
    | preFilterSize | Size of the prefilter. | 
  
   
 
 
  
  
      
        
          | float rdf::BaseBinarizationSu::strokeWidth  | 
          ( | 
          const cv::Mat &  | 
          contrastImg | ) | 
           const | 
         
       
   | 
  
protectedvirtual   | 
  
 
 
  
  
      
        
          | float rdf::BaseBinarizationSu::thresholdVal  | 
          ( | 
          float *  | 
          mean,  | 
         
        
           | 
           | 
          float *  | 
          std  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
inlineprotectedvirtual   | 
  
 
 
  
  
      
        
          | QString rdf::BaseBinarizationSu::toString  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
overridevirtual   | 
  
 
 
  
  
      
        
          | cv::Mat rdf::BaseBinarizationSu::mBwImg | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | cv::Mat rdf::BaseBinarizationSu::mMask | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | bool rdf::BaseBinarizationSu::mPreFilter = true | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | int rdf::BaseBinarizationSu::mPreFilterSize = 10 | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | cv::Mat rdf::BaseBinarizationSu::mSrcImg | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | float rdf::BaseBinarizationSu::mStrokeW = 4 | 
         
       
   | 
  
protected   | 
  
 
 
The documentation for this class was generated from the following files: