38 #pragma warning(push, 0) // no warnings from includes 43 #pragma warning (disable: 4251) // inlined Qt functions in dll interface 46 #ifdef DLL_CORE_EXPORT 47 #define DllCoreExport Q_DECL_EXPORT 49 #define DllCoreExport Q_DECL_IMPORT 62 double maxSlopeRotat()
const;
63 void setMaxSlopeRotat(
double s);
65 int minLength()
const;
66 void setMinLength(
int l);
68 double maxGap()
const;
69 void setMaxGap(
double g);
71 double maxAngleDiff()
const;
72 void setMaxAngleDiff(
double a);
74 QString toString()
const override;
77 void load(
const QSettings& settings)
override;
78 void save(QSettings& settings)
const override;
80 double mMaxSlopeRotat = 10.0;
83 double mMaxAngleDiff = 2.0;
91 QVector<rdf::Line> filterLineAngle(
const QVector<rdf::Line>& lines,
double angle,
double angleDiff = DBL_MAX)
const;
92 QVector<rdf::Line> mergeLines(
const QVector<rdf::Line>& lines, QVector<rdf::Line>* gaps = 0,
double maxGap = DBL_MAX,
double maxAngleDiff = DBL_MAX)
const;
93 QVector<rdf::Line> removeSmall(
const QVector<rdf::Line>& lines,
int minLineLength = 0)
const;
95 QSharedPointer<LineFilterConfig>
config()
const;
108 int minWidth()
const;
109 void setMinWidth(
int w);
111 double maxLenDiff()
const;
112 void setMaxLenDiff(
double l);
115 void setMaxLen(
int l);
117 int minLenSecondRun()
const;
118 void setMinLenSecondRun(
int r);
120 float maxDistExtern()
const;
121 void setMaxDistExtern(
float d);
123 float maxAngleDiffExtern()
const;
124 void setMaxAngleDiffExtern(
float a);
126 double maxAspectRatio()
const;
127 void setMaxAspectRatio(
double a);
129 QString toString()
const override;
132 void load(
const QSettings& settings)
override;
133 void save(QSettings& settings)
const override;
135 int mMinLenSecondRun = 60;
136 double mMaxLenDiff = 1.5;
137 double mMaxAspectRatio = 0.3;
142 float mMaxDistExtern = 10.0f;
143 float mMaxAngleDiffExtern = 20.0f / 180.0f * (float)CV_PI;
154 LineTrace(
const cv::Mat& img,
const cv::Mat& mask = cv::Mat());
156 bool isEmpty()
const override;
157 virtual bool compute()
override;
158 QVector<rdf::Line> getHLines()
const;
159 QVector<rdf::Line> getVLines()
const;
160 QVector<rdf::Line> getLines()
const;
161 void setAngle(
double angle = std::numeric_limits<double>::infinity());
164 QSharedPointer<LineTraceConfig>
config()
const;
166 cv::Mat lineImage()
const;
167 cv::Mat generatedLineImage()
const;
168 static void generateLineImage(
const QVector<rdf::Line>& hline,
const QVector<rdf::Line>& vline, cv::Mat& img, cv::Scalar hCol = cv::Scalar(255), cv::Scalar vCol = cv::Scalar(255), cv::Point2d offset = cv::Point(0,0));
169 virtual QString toString()
const override;
172 bool checkInput()
const override;
185 double mAngle = std::numeric_limits<double>::infinity();
190 cv::Mat hDSCC(
const cv::Mat& bwImg)
const;
191 void filter(cv::Mat& hDSCCImg, cv::Mat& vDSCCImg);
193 void drawGapLines(cv::Mat& img, QVector<rdf::Line> lines);
201 void setScale(
double scale);
202 double scale()
const;
204 void setMergeLines(
bool merge);
205 bool mergeLines()
const;
207 QString toString()
const override;
210 void load(
const QSettings& settings)
override;
211 void save(QSettings& settings)
const override;
214 bool mMergeLines =
true;
228 bool isEmpty()
const override;
229 virtual bool compute()
override;
231 QVector<Line> lines()
const;
232 QVector<Line> separatorLines()
const;
234 QSharedPointer<LineTraceLSDConfig>
config()
const;
237 virtual QString toString()
const override;
239 cv::Mat draw(
const cv::Mat& img)
const;
246 bool checkInput()
const override;
Definition: LineTrace.h:196
QVector< rdf::Line > hLines
Definition: LineTrace.h:178
QVector< rdf::Line > vLines
Definition: LineTrace.h:179
cv::Mat mSrcImg
Definition: LineTrace.h:174
Definition: BaseModule.h:63
Definition: LineTrace.h:86
#define DllCoreExport
Definition: BaseImageElement.h:43
cv::Mat mLineImg
Definition: LineTrace.h:175
QSharedPointer< LineFilterConfig > mConfig
Definition: LineTrace.h:99
Definition: LineTrace.h:103
cv::Mat mImg
Definition: LineTrace.h:242
LineFilter mLineFilter
Definition: LineTrace.h:244
Detects Lines in a binary image. The result is a binary image containing all line elements (pixel acc...
Definition: LineTrace.h:151
bool merge(const QSharedPointer< TextLineSet > &tl1, const QSharedPointer< TextLineSet > &tl2)
Definition: PixelSet.cpp:1728
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
Definition: LineTrace.h:57
Detect lines using the LSD algorithm. This line finder implements the LSD method from OpenCV contrib...
Definition: LineTrace.h:223
DllCoreExport QImage load(const QString &path, bool *ok=0)
Definition: Image.cpp:152
LineFilter mLineFilter
Definition: LineTrace.h:181
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
cv::Mat mMask
Definition: LineTrace.h:176
QVector< Line > mLines
Definition: LineTrace.h:243