37 #pragma warning(push, 0) // no warnings from includes 40 #include <opencv2/core.hpp> 44 #pragma warning (disable: 4251) // inlined Qt functions in dll interface 47 #ifdef DLL_CORE_EXPORT 48 #define DllCoreExport Q_DECL_EXPORT 50 #define DllCoreExport Q_DECL_IMPORT 65 virtual QString toString()
const override;
71 void load(
const QSettings& settings)
override;
72 void save(QSettings& settings)
const override;
85 bool isEmpty()
const override;
86 bool compute()
override;
87 cv::Mat binaryImage()
const;
88 QString toString()
const override;
90 QSharedPointer<SimpleBinarizationConfig>
config()
const;
96 bool checkInput()
const override;
105 int erodedMaskSize()
const;
106 void setErodedMaskSize(
int s);
108 QString toString()
const override;
111 void load(
const QSettings& settings)
override;
112 void save(QSettings& settings)
const override;
114 int mErodeMaskSize = 3 * 6;
127 bool isEmpty()
const override;
128 virtual bool compute()
override;
129 cv::Mat binaryImage()
const;
130 virtual QString toString()
const override;
131 void setPreFiltering(
bool preFilter =
true,
int preFilterSize = 10);
133 QSharedPointer<BaseBinarizationSuConfig>
config()
const;
136 cv::Mat compContrastImg(
const cv::Mat& srcImg,
const cv::Mat& mask)
const;
137 cv::Mat compBinContrastImg(
const cv::Mat& contrastImg)
const;
138 virtual float contrastVal(
const unsigned char* maxVal,
const unsigned char * minVal)
const;
139 virtual void calcFilterParams(
int &filterS,
int &Nm);
140 virtual float strokeWidth(
const cv::Mat& contrastImg)
const;
141 virtual float thresholdVal(
float *mean,
float *std)
const;
142 void computeDistHist(
const cv::Mat& src, QList<int> *maxDiffList, QList<float> *localIntensity)
const;
143 void computeThrImg(
const cv::Mat& grayImg32F,
const cv::Mat& binContrast, cv::Mat& thresholdImg, cv::Mat& thresholdContrastPxImg);
144 bool checkInput()
const override;
155 bool mPreFilter =
true;
156 int mPreFilterSize = 10;
172 virtual bool compute()
override;
173 virtual QString toString()
const override;
174 void setFiltering(
bool medianFilter);
177 float setStrokeWidth(
float strokeW);
178 virtual float thresholdVal(
float *mean,
float *std)
const;
179 virtual float contrastVal(
const unsigned char* maxVal,
const unsigned char * minVal)
const override;
180 virtual void calcFilterParams(
int &filterS,
int &Nm)
override;
186 bool mMedianFilter =
true;
201 virtual bool compute()
override;
204 cv::Mat computeFgd()
const;
205 cv::Mat computeMeanFgdEst(
const cv::Mat& grayImg32F,
const cv::Mat& mask)
const;
206 cv::Scalar computeConfidence()
const;
208 virtual void weightFunction(cv::Mat& grayImg, cv::Mat& thrImg,
const cv::Mat& mask);
210 int mFgdEstFilterSize = 32;
211 float mSigmSlope = 15.0f;
213 cv::Scalar mMeanContrast = cv::Scalar(-1.0f,-1.0f,-1.0f,-1.0f);
214 cv::Scalar mStdContrast = cv::Scalar(-1.0f,-1.0f,-1.0f,-1.0f);
215 float mConfidence = -1.0f;
cv::Mat mSrcImg
Definition: Binarization.h:148
Definition: Binarization.h:58
Definition: BaseModule.h:63
#define DllCoreExport
Definition: BaseImageElement.h:43
cv::Mat mMask
Definition: Binarization.h:150
cv::Mat mBinContrastImg
Definition: Binarization.h:183
The class binarize a rgb color image. To make the algorithm robust against noise, the foreground is e...
Definition: Binarization.h:196
cv::Mat mContrastImg
Definition: Binarization.h:182
cv::Mat mBwImg
Definition: Binarization.h:149
A simple binarization module using a defined threshold.
Definition: Binarization.h:80
config
Definition: DependencyCollector.py:271
The class binarize a grayvalue image. The segmentation algorithm is based on "Binarization of Histori...
Definition: Binarization.h:167
DllCoreExport bool save(const QImage &img, const QString &savePath, int compression=-1)
Saves the specified QImage img.
Definition: Image.cpp:180
Definition: Binarization.h:100
DllCoreExport QImage load(const QString &path, bool *ok=0)
Definition: Image.cpp:152
cv::Mat mFgdEstImg
Definition: Binarization.h:212
This is the base class for all modules. It provides all functions which are implemented by the module...
Definition: BaseModule.h:126
cv::Mat mThrImg
Definition: Binarization.h:184
Definition: Algorithms.cpp:45
The class binarize a grayvalue image. The segmentation algorithm is based on "Binarization of Histori...
Definition: Binarization.h:122