Engauge Digitizer 2
|
Class that 'heals' the curves after one grid line has been removed. More...
#include <GridHealerAbstractBase.h>
Public Member Functions | |
GridHealerAbstractBase (GridLog &gridLog, const DocumentModelGridRemoval &modelGridRemoval) | |
Single constructor. | |
virtual | ~GridHealerAbstractBase () |
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 | healed (QImage &image) |
Return healed image after grid removal. | |
Static Public Member Functions | |
static int | pixelCountInRegionThreshold (const DocumentModelGridRemoval &modelGridRemoval) |
Threshold number of pixels in a region to be considered too-small or big-enough. | |
Protected Member Functions | |
virtual void | applyMutualPairs (const QImage &image)=0 |
Apply mutual pair points after all grid removal is done. | |
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 | 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. | |
GridLog & | gridLog () |
Logging get method. | |
double | maxPointSeparation () const |
Max point separation get method. | |
DocumentModelGridRemoval & | modelGridRemoval () |
DocumentModelGridRemoval get method. | |
const MutualPairHalves & | mutualPairHalvesAbove () const |
Mutual pair halves for below grid line. | |
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 | saveGapSeparation (double gapSeparation) |
Gap separation set method. | |
Class that 'heals' the curves after one grid line has been removed.
Specifically, gaps that span the pixels in the removed grid line are filled in, when a black pixel on one side of the gap is across from a black pixel on the other side of the pixel
A range is defined as a continous set of pixels on the same side of the gap
Definition at line 30 of file GridHealerAbstractBase.h.
GridHealerAbstractBase::GridHealerAbstractBase | ( | GridLog & | gridLog, |
const DocumentModelGridRemoval & | modelGridRemoval ) |
Single constructor.
Definition at line 20 of file GridHealerAbstractBase.cpp.
|
virtual |
Definition at line 28 of file GridHealerAbstractBase.cpp.
Add two points on either side of a gap. Later, after removal, the black points will be processed.
Definition at line 32 of file GridHealerAbstractBase.cpp.
Apply mutual pair points after all grid removal is done.
Implemented in GridHealerHorizontal, and GridHealerVertical.
Guts of the algorithm in which sequences of black pixels across the gap from each other are filled in.
Specifically, trapezoids with endpoints separated by no more than the closest distance are filled in. A greedy algorithm is used which makes each trapezoid as big as possible
Implemented in GridHealerHorizontal, and GridHealerVertical.
|
protected |
Fill trapezoid with bottom left, bottom right, top right, and top left points.
Definition at line 41 of file GridHealerAbstractBase.cpp.
|
protected |
Logging get method.
Definition at line 81 of file GridHealerAbstractBase.cpp.
Return healed image after grid removal.
Definition at line 86 of file GridHealerAbstractBase.cpp.
|
protected |
Max point separation get method.
Definition at line 92 of file GridHealerAbstractBase.cpp.
|
protected |
DocumentModelGridRemoval get method.
Definition at line 97 of file GridHealerAbstractBase.cpp.
|
protected |
Mutual pair halves for below grid line.
Definition at line 102 of file GridHealerAbstractBase.cpp.
|
protected |
Mutual pair halves for above grid line.
Definition at line 107 of file GridHealerAbstractBase.cpp.
|
static |
Threshold number of pixels in a region to be considered too-small or big-enough.
Definition at line 112 of file GridHealerAbstractBase.cpp.
|
protected |
Apply blackPixelRegionIsBigEnough to regions around each of two points.
Definition at line 118 of file GridHealerAbstractBase.cpp.
Gap separation set method.
Definition at line 134 of file GridHealerAbstractBase.cpp.