7 #ifndef GRID_HEALER_ABSTRACT_BASE_H
8 #define GRID_HEALER_ABSTRACT_BASE_H
10 #include "DocumentModelGridRemoval.h"
11 #include "GridIndependentToDependent.h"
19 const double HALFWIDTH_HORIZONTAL = 0.46;
20 const double HALFWIDTH_VERTICAL = 0.54;
23 typedef QList<QPoint> MutualPairHalves;
49 void healed (QImage &image);
104 bool blackPixelRegionIsBigEnough (
const QImage &image,
109 void doHealingOnBelowAndAboveRangePair (QImage &image,
116 void doHealingOnBelowRange (QImage &image,
123 int m_maxPointSeparation;
128 MutualPairHalves m_mutualPairHalvesBelow;
129 MutualPairHalves m_mutualPairHalvesAbove;
134 #endif // GRID_HEALER_ABSTRACT_BASE_H
Class that does special logging for GridLog and GridRemoval classes.
void saveGapSeparation(double gapSeparation)
Gap separation set method.
virtual void doHealingAcrossGaps(QImage &image)=0
Guts of the algorithm in which sequences of black pixels across the gap from each other are filled in...
void healed(QImage &image)
Return healed image after grid removal.
bool pointsAreGood(const QImage &image, int x0, int y0, int x1, int y1) const
Apply blackPixelRegionIsBigEnough to regions around each of two points.
Class that 'heals' the curves after one grid line has been removed.
GridLog & gridLog()
Logging get method.
double maxPointSeparation() const
Max point separation get method.
virtual void applyMutualPairs(const QImage &image)=0
Apply mutual pair points after all grid removal is done.
static int pixelCountInRegionThreshold(const DocumentModelGridRemoval &modelGridRemoval)
Threshold number of pixels in a region to be considered too-small or big-enough.
const MutualPairHalves & mutualPairHalvesBelow() const
Mutual pair halves for above grid line.
const MutualPairHalves & mutualPairHalvesAbove() const
Mutual pair halves for below grid line.
void addMutualPair(int x0, int y0, int x1, int y1)
Add two points on either side of a gap. Later, after removal, the black points will be processed...
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
DocumentModelGridRemoval & modelGridRemoval()
DocumentModelGridRemoval get method.
void fillTrapezoid(QImage &image, int xBL, int yBL, int xBR, int yBR, int xTR, int yTR, int xTL, int yTL)
Fill trapezoid with bottom left, bottom right, top right, and top left points.