39 #pragma warning(push, 0) // no warnings from includes 44 #ifdef DLL_CORE_EXPORT 45 #define DllCoreExport Q_DECL_EXPORT 47 #define DllCoreExport Q_DECL_IMPORT 64 double scaleFactor()
const;
68 void load(
const QSettings& settings)
override;
69 void save(QSettings& settings)
const override;
71 double mScaleFactor = 1000.0;
84 virtual bool isEmpty()
const override;
86 QSharedPointer<GraphCutConfig>
config()
const;
105 QSharedPointer<GCoptimizationGeneralGraph> graphCut(
const PixelGraph& graph)
const;
116 virtual cv::Mat costs(
int numLabels)
const = 0;
125 virtual cv::Mat labelDistMatrix(
int numLabels)
const = 0;
127 virtual int numLabels()
const = 0;
139 virtual bool compute()
override;
141 cv::Mat draw(
const cv::Mat& img,
const QColor& col = QColor())
const;
145 bool checkInput()
const override;
147 cv::Mat costs(
int numLabels)
const override;
148 cv::Mat labelDistMatrix(
int numLabels)
const override;
149 int numLabels()
const override;
161 virtual bool compute()
override;
163 cv::Mat draw(
const cv::Mat& img,
const QColor& col = QColor())
const;
169 bool checkInput()
const override;
171 cv::Mat costs(
int numLabels)
const override;
172 cv::Mat labelDistMatrix(
int numLabels)
const override;
173 int numLabels()
const override;
183 int numLabels()
const;
186 void load(
const QSettings& settings)
override;
187 void save(QSettings& settings)
const override;
202 virtual bool compute()
override;
204 QSharedPointer<GraphCutLineSpacingConfig>
config()
const;
206 cv::Mat draw(
const cv::Mat& img,
const QColor& col = QColor())
const;
210 bool checkInput()
const override;
212 cv::Mat costs(
int numLabels)
const override;
213 cv::Mat labelDistMatrix(
int numLabels)
const override;
214 int numLabels()
const override;
231 virtual bool compute()
override;
233 cv::Mat draw(
const cv::Mat& img,
const QColor& col = QColor())
const;
235 QVector<PixelSet> textLines();
239 QVector<PixelSet> mTextLines;
241 bool checkInput()
const override;
243 cv::Mat costs(
int numLabels)
const override;
244 cv::Mat labelDistMatrix(
int numLabels)
const override;
245 int numLabels()
const override;
247 cv::Mat mahalanobisDists(
const PixelSet& tl,
const cv::Mat& centers)
const;
248 cv::Mat euclideanDists(
const PixelSet& tl)
const;
249 cv::Mat pixelSetCentersToMat(
const PixelSet&
set)
const;
251 void saveDistsDebug(
const QString& filePath,
const cv::Mat& img)
const;
253 template <
typename num>
254 cv::Mat makeSymmetric(
const cv::Mat& m)
const {
256 assert(m.cols == m.rows);
257 cv::Mat s = m.clone();
260 num* lp = s.ptr<num>();
262 for (
int rIdx = 0; rIdx < s.rows; rIdx++) {
264 for (
int cIdx = rIdx+1; cIdx < s.cols; cIdx++) {
266 num* rl = lp + (rIdx * s.rows + cIdx);
267 num* cl = lp + (rIdx + cIdx * s.cols);
269 num val = qMin(*rl, *cl);
PixelDistance::EdgeWeightFunction mWeightFnc
Definition: GraphCut.h:95
PixelSet mSet
Definition: GraphCut.h:94
Definition: BaseModule.h:63
Graph cut for local orientation estimation.
Definition: GraphCut.h:134
#define DllCoreExport
Definition: BaseImageElement.h:43
PixelSet stores and manipulates pixel collections.
Definition: PixelSet.h:172
QSharedPointer< PixelConnector > mConnector
Definition: GraphCut.h:96
This class manages all labels loaded. It can be used to compare LabelInfo objects, and load them.
Definition: PixelLabel.h:125
Definition: GraphCut.h:178
The base class for all graphcuts operating on pixels.
Definition: GraphCut.h:79
Textline clustering using graph-cut.
Definition: GraphCut.h:226
Graph cut for line spacing.
Definition: GraphCut.h:197
DllCoreExport typedef double(* EdgeWeightFunction)(const PixelEdge *edge)
Definition: Algorithms.h:168
Represents a pixel graph. This class comes in handy if you want to map pixel edges with pixels...
Definition: PixelSet.h:377
Definition: GraphCut.h:59
config
Definition: DependencyCollector.py:271
Definition: GCoptimization.h:569
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
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
Graph cut for pixel labeling.
Definition: GraphCut.h:156