Go to the documentation of this file.
18 #include <QTextStream>
22 m_modelGridRemoval (modelGridRemoval),
23 m_maxPointSeparation (0),
37 m_mutualPairHalvesBelow.push_back (QPoint (x0, y0));
38 m_mutualPairHalvesAbove.push_back (QPoint (x1, y1));
48 if (xBL == 0 || yBL == 0 || xBR == 0 || yBR == 0 || xTR == 0 || yTR == 0 || xTL == 0 || yTL == 0) {
49 LOG4CPP_ERROR_S ((*
mainCat)) <<
"GridHealerAbstractBase::fillTrapezoid received undefined corner coordinate "
50 <<
"xBL=" << xBL <<
" yBL=" << yBL <<
" xBR=" << xBR <<
" yBR=" << yBR
51 <<
"xTR=" << xTR <<
" yTR=" << yTR <<
" xTL=" << xTL <<
" yTL=" << yTL;
69 triangleFill.
fill (m_gridLog,
74 triangleFill.
fill (m_gridLog,
94 return m_maxPointSeparation;
99 return m_modelGridRemoval;
104 return m_mutualPairHalvesAbove;
109 return m_mutualPairHalvesBelow;
138 m_maxPointSeparation = qFloor (qSqrt (qPow (
modelGridRemoval().closeDistance(), 2) -
139 qPow (gapSeparation, 2)));
static int pixelCountInRegionThreshold(const DocumentModelGridRemoval &modelGridRemoval)
Threshold number of pixels in a region to be considered too-small or big-enough.
GridLog & gridLog()
Logging get method.
int countBlackPixelsAroundPoint(const QImage &image, int x, int y, int stopCountAt)
Fill triangle between these three points.
virtual void applyMutualPairs(const QImage &image)=0
Apply mutual pair points after all grid removal is done.
Class that does raster-line fill of a triangle, with logging customizations for GridHealer (and there...
#define LOG4CPP_ERROR_S(logger)
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.
void fill(GridLog &gridLog, QImage &image, const QPoint &p0, const QPoint &p1, const QPoint &p2)
Fill triangle between these three points.
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.
Utility class for pixel manipulation.
void saveGapSeparation(double gapSeparation)
Gap separation set method.
double maxPointSeparation() const
Max point separation get method.
log4cpp::Category * mainCat
QList< QPoint > MutualPairHalves
Save one half of a mutual pair.
virtual ~GridHealerAbstractBase()
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...
double closeDistance() const
Get method for close distance.
const MutualPairHalves & mutualPairHalvesBelow() const
Mutual pair halves for above grid line.
bool pointsAreGood(const QImage &image, int x0, int y0, int x1, int y1) const
Apply blackPixelRegionIsBigEnough to regions around each of two points.
void healed(QImage &image)
Return healed image after grid removal.
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
GridHealerAbstractBase(GridLog &gridLog, const DocumentModelGridRemoval &modelGridRemoval)
Single constructor.
Class that does special logging for GridLog and GridRemoval classes.
static bool pixelIsBlack(const QImage &image, int x, int y)
Return true if pixel is black in black and white image.