ReadFramework
|
#include <FormAnalysis.h>
Public Member Functions | |
FormFeatures () | |
FormFeatures (const cv::Mat &img, const cv::Mat &mask=cv::Mat()) | |
void | setInputImg (const cv::Mat &img) |
void | setMask (const cv::Mat &mask) |
bool | isEmpty () const override |
Returns true if the module was initialized with the default constructor. Note, if empty is true, nothing can be computed. More... | |
bool | compute () override |
Runs the algorithm implemented by the module. More... | |
bool | computeBinaryInput () |
bool | readTemplate (QSharedPointer< rdf::FormFeatures > templateForm) |
bool | estimateRoughAlignment (bool useBinaryImg=false) |
cv::Mat | drawAlignment (cv::Mat img=cv::Mat()) |
cv::Mat | drawMatchedForm (cv::Mat img=cv::Mat(), float t=10.0) |
cv::Mat | drawLinesNotUsedForm (cv::Mat img=cv::Mat(), float t=10.0) |
cv::Mat | drawLines (cv::Mat img=cv::Mat(), float t=10.0) |
cv::Mat | drawMaxClique (cv::Mat img=cv::Mat(), float t=10.0, int idx=0) |
cv::Mat | drawMaxCliqueNeighbours (int cellIdx, AssociationGraphNode::LinePosition lp, int nodeCnt=-1, cv::Mat img=cv::Mat(), float t=10.0) |
QSharedPointer< rdf::TableRegion > | tableRegion () |
QSharedPointer< rdf::TableRegion > | tableRegionTemplate () |
QVector< QSharedPointer< rdf::TableCellRaw > > | createRawTableFromTemplate () |
void | createAssociationGraphNodes (QVector< QSharedPointer< rdf::TableCellRaw >> cellsR) |
void | createReducedAssociationGraphNodes (QVector< QSharedPointer< rdf::TableCellRaw >> cellsR) |
QVector< QSharedPointer< rdf::AssociationGraphNode > > | mergeColinearNodes (QVector< QSharedPointer< rdf::AssociationGraphNode >> &tmpNodes) |
void | createAssociationGraph () |
bool ** | adjacencyMatrix (const QVector< QSharedPointer< rdf::AssociationGraphNode >> &associationGraphNodes) |
void | findMaxCliques () |
void | createTableFromMaxClique (const QVector< QSharedPointer< rdf::TableCell >> &cells) |
void | createTableFromMaxCliqueReduced (const QVector< QSharedPointer< rdf::TableCell >> &cells) |
QVector< QSet< int > > | getMaxCliqueHor () const |
QVector< QSet< int > > | getMaxCliqueVer () const |
bool | matchTemplate () |
rdf::LineCandidates | findLineCandidates (rdf::Line l, double distThreshold, bool horizontal=true) |
double | findMinWidth (QVector< QSharedPointer< rdf::TableCellRaw >> cellsR, int cellIdx, int neighbour) |
rdf::Polygon | createPolygon (rdf::Line tl, rdf::Line ll, rdf::Line rl, rdf::Line bl) |
void | createCellfromLineCandidates (QVector< QSharedPointer< rdf::TableCellRaw >> cellsR) |
bool | isEmptyLines () const |
bool | isEmptyTable () const |
bool | setTemplateName (QString s) |
QString | templateName () const |
cv::Size | sizeImg () const |
void | setSize (cv::Size s) |
QVector< rdf::Line > | horLines () const |
void | setHorLines (const QVector< rdf::Line > &h) |
QVector< rdf::Line > | verLines () const |
void | setVerLines (const QVector< rdf::Line > &v) |
QVector< rdf::Line > | usedHorLines () const |
QVector< rdf::Line > | notUsedHorLines () const |
QVector< rdf::Line > | filterHorLines (double minOverlap=0.1, double distThreshold=20) const |
QVector< rdf::Line > | useVerLines () const |
QVector< rdf::Line > | notUseVerLines () const |
QVector< rdf::Line > | filterVerLines (double minOverlap=0.1, double distThreshold=20) const |
double | lineDistance (rdf::Line templateLine, rdf::Line formLine, double minOverlap=0.1, bool horizontal=true) |
cv::Point | offset () const |
double | error () const |
QSharedPointer< FormFeaturesConfig > | config () const |
void | setConfig (QSharedPointer< FormFeaturesConfig > c) |
cv::Mat | binaryImage () const |
void | setEstimateSkew (bool s) |
QString | toString () const override |
Converts the module's parameters and results to a string. More... | |
void | setFormName (QString s) |
QString | formName () const |
void | setCells (QVector< QSharedPointer< rdf::TableCell >> c) |
QVector< QSharedPointer< rdf::TableCell > > | cells () const |
void | setRegion (QSharedPointer< rdf::TableRegion > r) |
QSharedPointer< rdf::TableRegion > | region () const |
void | setSeparators (QSharedPointer< rdf::Region > r) |
Public Member Functions inherited from rdf::Module | |
Module () | |
Default constructor Initializes a new instance of the Module class. More... | |
virtual QString | name () const |
Returns the module's name. More... | |
virtual void | setConfig (QSharedPointer< ModuleConfig > config) |
QSharedPointer< ModuleConfig > | config () const |
Additional Inherited Members | |
Protected Member Functions inherited from rdf::Module | |
QString | debugName () const |
Protected Attributes inherited from rdf::Module | |
QSharedPointer< ModuleConfig > | mConfig |
rdf::FormFeatures::FormFeatures | ( | ) |
rdf::FormFeatures::FormFeatures | ( | const cv::Mat & | img, |
const cv::Mat & | mask = cv::Mat() |
||
) |
bool ** rdf::FormFeatures::adjacencyMatrix | ( | const QVector< QSharedPointer< rdf::AssociationGraphNode >> & | associationGraphNodes | ) |
cv::Mat rdf::FormFeatures::binaryImage | ( | ) | const |
QVector< QSharedPointer< rdf::TableCell > > rdf::FormFeatures::cells | ( | ) | const |
|
overridevirtual |
Runs the algorithm implemented by the module.
Implements rdf::Module.
bool rdf::FormFeatures::computeBinaryInput | ( | ) |
QSharedPointer< FormFeaturesConfig > rdf::FormFeatures::config | ( | ) | const |
void rdf::FormFeatures::createAssociationGraph | ( | ) |
void rdf::FormFeatures::createAssociationGraphNodes | ( | QVector< QSharedPointer< rdf::TableCellRaw >> | cellsR | ) |
void rdf::FormFeatures::createCellfromLineCandidates | ( | QVector< QSharedPointer< rdf::TableCellRaw >> | cellsR | ) |
rdf::Polygon rdf::FormFeatures::createPolygon | ( | rdf::Line | tl, |
rdf::Line | ll, | ||
rdf::Line | rl, | ||
rdf::Line | bl | ||
) |
QVector< QSharedPointer< rdf::TableCellRaw > > rdf::FormFeatures::createRawTableFromTemplate | ( | ) |
void rdf::FormFeatures::createReducedAssociationGraphNodes | ( | QVector< QSharedPointer< rdf::TableCellRaw >> | cellsR | ) |
void rdf::FormFeatures::createTableFromMaxClique | ( | const QVector< QSharedPointer< rdf::TableCell >> & | cells | ) |
void rdf::FormFeatures::createTableFromMaxCliqueReduced | ( | const QVector< QSharedPointer< rdf::TableCell >> & | cells | ) |
cv::Mat rdf::FormFeatures::drawAlignment | ( | cv::Mat | img = cv::Mat() | ) |
cv::Mat rdf::FormFeatures::drawLines | ( | cv::Mat | img = cv::Mat() , |
float | t = 10.0 |
||
) |
cv::Mat rdf::FormFeatures::drawLinesNotUsedForm | ( | cv::Mat | img = cv::Mat() , |
float | t = 10.0 |
||
) |
cv::Mat rdf::FormFeatures::drawMatchedForm | ( | cv::Mat | img = cv::Mat() , |
float | t = 10.0 |
||
) |
cv::Mat rdf::FormFeatures::drawMaxClique | ( | cv::Mat | img = cv::Mat() , |
float | t = 10.0 , |
||
int | idx = 0 |
||
) |
cv::Mat rdf::FormFeatures::drawMaxCliqueNeighbours | ( | int | cellIdx, |
AssociationGraphNode::LinePosition | lp, | ||
int | nodeCnt = -1 , |
||
cv::Mat | img = cv::Mat() , |
||
float | t = 10.0 |
||
) |
double rdf::FormFeatures::error | ( | ) | const |
bool rdf::FormFeatures::estimateRoughAlignment | ( | bool | useBinaryImg = false | ) |
QVector< rdf::Line > rdf::FormFeatures::filterHorLines | ( | double | minOverlap = 0.1 , |
double | distThreshold = 20 |
||
) | const |
QVector< rdf::Line > rdf::FormFeatures::filterVerLines | ( | double | minOverlap = 0.1 , |
double | distThreshold = 20 |
||
) | const |
rdf::LineCandidates rdf::FormFeatures::findLineCandidates | ( | rdf::Line | l, |
double | distThreshold, | ||
bool | horizontal = true |
||
) |
void rdf::FormFeatures::findMaxCliques | ( | ) |
double rdf::FormFeatures::findMinWidth | ( | QVector< QSharedPointer< rdf::TableCellRaw >> | cellsR, |
int | cellIdx, | ||
int | neighbour | ||
) |
QString rdf::FormFeatures::formName | ( | ) | const |
QVector< QSet< int > > rdf::FormFeatures::getMaxCliqueHor | ( | ) | const |
QVector< QSet< int > > rdf::FormFeatures::getMaxCliqueVer | ( | ) | const |
QVector< rdf::Line > rdf::FormFeatures::horLines | ( | ) | const |
|
overridevirtual |
Returns true if the module was initialized with the default constructor. Note, if empty is true, nothing can be computed.
Implements rdf::Module.
bool rdf::FormFeatures::isEmptyLines | ( | ) | const |
bool rdf::FormFeatures::isEmptyTable | ( | ) | const |
double rdf::FormFeatures::lineDistance | ( | rdf::Line | templateLine, |
rdf::Line | formLine, | ||
double | minOverlap = 0.1 , |
||
bool | horizontal = true |
||
) |
bool rdf::FormFeatures::matchTemplate | ( | ) |
QVector< QSharedPointer< rdf::AssociationGraphNode > > rdf::FormFeatures::mergeColinearNodes | ( | QVector< QSharedPointer< rdf::AssociationGraphNode >> & | tmpNodes | ) |
QVector< rdf::Line > rdf::FormFeatures::notUsedHorLines | ( | ) | const |
QVector< rdf::Line > rdf::FormFeatures::notUseVerLines | ( | ) | const |
cv::Point rdf::FormFeatures::offset | ( | ) | const |
bool rdf::FormFeatures::readTemplate | ( | QSharedPointer< rdf::FormFeatures > | templateForm | ) |
QSharedPointer< rdf::TableRegion > rdf::FormFeatures::region | ( | ) | const |
void rdf::FormFeatures::setCells | ( | QVector< QSharedPointer< rdf::TableCell >> | c | ) |
void rdf::FormFeatures::setConfig | ( | QSharedPointer< FormFeaturesConfig > | c | ) |
void rdf::FormFeatures::setEstimateSkew | ( | bool | s | ) |
void rdf::FormFeatures::setFormName | ( | QString | s | ) |
void rdf::FormFeatures::setHorLines | ( | const QVector< rdf::Line > & | h | ) |
void rdf::FormFeatures::setInputImg | ( | const cv::Mat & | img | ) |
void rdf::FormFeatures::setMask | ( | const cv::Mat & | mask | ) |
void rdf::FormFeatures::setRegion | ( | QSharedPointer< rdf::TableRegion > | r | ) |
void rdf::FormFeatures::setSeparators | ( | QSharedPointer< rdf::Region > | r | ) |
void rdf::FormFeatures::setSize | ( | cv::Size | s | ) |
bool rdf::FormFeatures::setTemplateName | ( | QString | s | ) |
void rdf::FormFeatures::setVerLines | ( | const QVector< rdf::Line > & | v | ) |
cv::Size rdf::FormFeatures::sizeImg | ( | ) | const |
QSharedPointer< rdf::TableRegion > rdf::FormFeatures::tableRegion | ( | ) |
QSharedPointer< rdf::TableRegion > rdf::FormFeatures::tableRegionTemplate | ( | ) |
QString rdf::FormFeatures::templateName | ( | ) | const |
|
overridevirtual |
Converts the module's parameters and results to a string.
Reimplemented from rdf::Module.
QVector< rdf::Line > rdf::FormFeatures::usedHorLines | ( | ) | const |
QVector< rdf::Line > rdf::FormFeatures::useVerLines | ( | ) | const |
QVector< rdf::Line > rdf::FormFeatures::verLines | ( | ) | const |