39 #pragma warning(push, 0) // no warnings from includes 45 #include <opencv2/core.hpp> 48 #pragma warning (disable: 4251) // inlined Qt functions in dll interface 51 #ifdef DLL_CORE_EXPORT 52 #define DllCoreExport Q_DECL_EXPORT 54 #define DllCoreExport Q_DECL_IMPORT 72 void setHeight(
int h);
78 void setEpsilon(
int e);
80 int minLineLength()
const;
81 void setMinLineLength(
int l);
87 void setSigma(
double s);
90 void setThr(
double t);
98 QString toString()
const override;
101 void load(
const QSettings& settings)
override;
102 void save(QSettings& settings)
const override;
109 int mMinLineLength = 50;
131 void setImages(
const cv::Mat& img,
const cv::Mat& mask = cv::Mat());
135 QVector<QVector4D> getSelectedLines()
const;
137 bool isEmpty()
const override;
138 virtual QString toString()
const override;
140 void setFixedThr(
bool f);
142 QSharedPointer<BaseSkewEstimationConfig>
config()
const;
148 cv::Mat separability(
const cv::Mat& srcImg,
int w,
int h,
const cv::Mat& mask = cv::Mat());
149 cv::Mat edgeMap(
const cv::Mat& separability,
double thr,
EdgeDirection direction = HORIZONTAL,
const cv::Mat& mask = cv::Mat())
const;
150 QVector<QVector3D> computeWeights(cv::Mat edgeMap,
int delta,
int epsilon,
EdgeDirection direction = HORIZONTAL);
152 double skewEst(
const QVector<QVector3D>& weights,
double imgDiagonal,
bool& ok,
double eta=0.35);
153 bool checkInput()
const override;
157 double mSkewAngle = 0.0;
159 int mRotationFactor = 1;
160 bool mFixedThr =
true;
162 cv::Mat mIntegralImg;
163 cv::Mat mIntegralSqdImg;
165 QVector<QVector4D> mSelectedLines;
166 QVector<int> mSelectedLineTypes;
175 virtual QString toString()
const override;
177 double minAngle()
const;
178 double maxAngle()
const;
182 void load(
const QSettings& settings)
override;
183 void save(QSettings& settings)
const override;
185 double mMinAngle = -CV_PI;
186 double mMaxAngle = CV_PI;
199 bool isEmpty()
const override;
200 virtual QString toString()
const override;
202 QSharedPointer<TextLineSkewConfig>
config()
const;
204 cv::Mat draw(
const cv::Mat& img)
const;
205 cv::Mat rotated(
const cv::Mat& img)
const;
215 bool checkInput()
const override;
Definition: BaseModule.h:63
#define DllCoreExport
Definition: BaseImageElement.h:43
PixelSet stores and manipulates pixel collections.
Definition: PixelSet.h:172
Definition: SkewEstimation.h:63
The class estimates the skew of a document page. The methodology is based on "Skew estimation of natu...
Definition: SkewEstimation.h:125
cv::Mat mImg
Definition: SkewEstimation.h:208
config
Definition: DependencyCollector.py:271
DllCoreExport bool save(const QImage &img, const QString &savePath, int compression=-1)
Saves the specified QImage img.
Definition: Image.cpp:180
DllCoreExport QImage load(const QString &path, bool *ok=0)
Definition: Image.cpp:152
EdgeDirection
Definition: SkewEstimation.h:128
cv::Mat mSrcImg
Definition: SkewEstimation.h:145
QSharedPointer< ScaleFactory > mScaleFactory
Definition: SkewEstimation.h:211
This is the base class for all modules. It provides all functions which are implemented by the module...
Definition: BaseModule.h:126
Definition: Algorithms.cpp:45
Definition: SkewEstimation.h:170
Definition: SkewEstimation.h:190
cv::Mat mMask
Definition: SkewEstimation.h:146
PixelSet mSet
Definition: SkewEstimation.h:210