ReadFramework
rdf::BinarizationSuFgdWeight Class Reference

The class binarize a rgb color image. To make the algorithm robust against noise, the foreground is estimated and the image is weighted with the foreground. (Foreground estimation is performed by a Mean Filter with a size of 32x32 px). More...

#include <Binarization.h>

Inheritance diagram for rdf::BinarizationSuFgdWeight:
Collaboration diagram for rdf::BinarizationSuFgdWeight:

Public Member Functions

 BinarizationSuFgdWeight (const cv::Mat &img, const cv::Mat &mask=cv::Mat())
 Initializes a new instance of the BinarizationSuFgdWeight class. More...
 
virtual bool compute () override
 Computes the foreground weighted image. More...
 
- Public Member Functions inherited from rdf::BinarizationSuAdapted
 BinarizationSuAdapted (const cv::Mat &img, const cv::Mat &mask=cv::Mat())
 Initializes a new instance of the BinarizationSuAdapted class. More...
 
virtual QString toString () const override
 Summary of parameters as String. More...
 
void setFiltering (bool medianFilter)
 If set, a median filter of size 3 is applied at the end. More...
 
- Public Member Functions inherited from rdf::BaseBinarizationSu
 BaseBinarizationSu (const cv::Mat &img, const cv::Mat &mask=cv::Mat())
 Initializes a new instance of the BaseBinarizationSu class. More...
 
bool isEmpty () const override
 Determines whether this instance is empty. More...
 
cv::Mat binaryImage () const
 Returns the binary image. More...
 
void setPreFiltering (bool preFilter=true, int preFilterSize=10)
 Sets the preFiltering. All blobs smaller than preFilterSize are removed if preFilter is true. More...
 
QSharedPointer< BaseBinarizationSuConfigconfig () const
 
- Public Member Functions inherited from rdf::Module
 Module ()
 Default constructor Initializes a new instance of the Module class. More...
 
virtual QString name () const
 Returns the module's name. More...
 
virtual void setConfig (QSharedPointer< ModuleConfig > config)
 
QSharedPointer< ModuleConfigconfig () const
 

Protected Member Functions

cv::Mat computeFgd () const
 
cv::Mat computeMeanFgdEst (const cv::Mat &grayImg32F, const cv::Mat &mask) const
 
cv::Scalar computeConfidence () const
 
virtual void weightFunction (cv::Mat &grayImg, cv::Mat &thrImg, const cv::Mat &mask)
 
- Protected Member Functions inherited from rdf::BinarizationSuAdapted
float setStrokeWidth (float strokeW)
 
virtual float thresholdVal (float *mean, float *std) const
 
virtual float contrastVal (const unsigned char *maxVal, const unsigned char *minVal) const override
 
virtual void calcFilterParams (int &filterS, int &Nm) override
 
- Protected Member Functions inherited from rdf::BaseBinarizationSu
cv::Mat compContrastImg (const cv::Mat &srcImg, const cv::Mat &mask) const
 
cv::Mat compBinContrastImg (const cv::Mat &contrastImg) const
 
virtual float strokeWidth (const cv::Mat &contrastImg) 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
 
- Protected Member Functions inherited from rdf::Module
QString debugName () const
 

Protected Attributes

int mFgdEstFilterSize = 32
 
float mSigmSlope = 15.0f
 
cv::Mat mFgdEstImg
 
cv::Scalar mMeanContrast = cv::Scalar(-1.0f,-1.0f,-1.0f,-1.0f)
 
cv::Scalar mStdContrast = cv::Scalar(-1.0f,-1.0f,-1.0f,-1.0f)
 
float mConfidence = -1.0f
 
- Protected Attributes inherited from rdf::BinarizationSuAdapted
cv::Mat mContrastImg
 
cv::Mat mBinContrastImg
 
cv::Mat mThrImg
 
- Protected Attributes inherited from rdf::BaseBinarizationSu
cv::Mat mSrcImg
 
cv::Mat mBwImg
 
cv::Mat mMask
 
bool mPreFilter = true
 
int mPreFilterSize = 10
 
float mStrokeW = 4
 
- Protected Attributes inherited from rdf::Module
QSharedPointer< ModuleConfigmConfig
 

Detailed Description

The class binarize a rgb color image. To make the algorithm robust against noise, the foreground is estimated and the image is weighted with the foreground. (Foreground estimation is performed by a Mean Filter with a size of 32x32 px).

See also
BinarizationSuAdapted

Constructor & Destructor Documentation

rdf::BinarizationSuFgdWeight::BinarizationSuFgdWeight ( const cv::Mat &  img,
const cv::Mat &  mask = cv::Mat() 
)

Initializes a new instance of the BinarizationSuFgdWeight class.

Parameters
imgThe img.
maskThe mask.

Member Function Documentation

bool rdf::BinarizationSuFgdWeight::compute ( )
overridevirtual

Computes the foreground weighted image.

Returns
True if the image could be computed.

Reimplemented from rdf::BinarizationSuAdapted.

Here is the caller graph for this function:

cv::Scalar rdf::BinarizationSuFgdWeight::computeConfidence ( ) const
protected

Here is the caller graph for this function:

cv::Mat rdf::BinarizationSuFgdWeight::computeFgd ( ) const
protected
cv::Mat rdf::BinarizationSuFgdWeight::computeMeanFgdEst ( const cv::Mat &  grayImg32F,
const cv::Mat &  mask 
) const
protected

Here is the caller graph for this function:

void rdf::BinarizationSuFgdWeight::weightFunction ( cv::Mat &  grayImg,
cv::Mat &  thrImg,
const cv::Mat &  mask 
)
protectedvirtual

Here is the caller graph for this function:

Member Data Documentation

float rdf::BinarizationSuFgdWeight::mConfidence = -1.0f
protected
int rdf::BinarizationSuFgdWeight::mFgdEstFilterSize = 32
protected
cv::Mat rdf::BinarizationSuFgdWeight::mFgdEstImg
protected
cv::Scalar rdf::BinarizationSuFgdWeight::mMeanContrast = cv::Scalar(-1.0f,-1.0f,-1.0f,-1.0f)
protected
float rdf::BinarizationSuFgdWeight::mSigmSlope = 15.0f
protected
cv::Scalar rdf::BinarizationSuFgdWeight::mStdContrast = cv::Scalar(-1.0f,-1.0f,-1.0f,-1.0f)
protected

The documentation for this class was generated from the following files: