Read@CVL
rdf::LineTrace Class Reference

Detects Lines in a binary image. The result is a binary image containing all line elements (pixel accurate) as well as all lines as vectors. It is also possible to filter lines according a specified angle. More...

#include <LineTrace.h>

Inheritance diagram for rdf::LineTrace:
Collaboration diagram for rdf::LineTrace:

Public Member Functions

 LineTrace (const cv::Mat &img, const cv::Mat &mask=cv::Mat())
 Initializes a new instance of the LineTrace class. More...
 
bool isEmpty () const override
 Determines whether this instance is empty. More...
 
virtual bool compute () override
 Computes the binary line image as will as the line vectors. More...
 
QVector< rdf::LinegetHLines () const
 Gets the horizontal lines. More...
 
QVector< rdf::LinegetVLines () const
 Gets the vertical lines. More...
 
QVector< rdf::LinegetLines () const
 
void setAngle (double angle=std::numeric_limits< double >::infinity())
 Sets the angle to filter the lines horizontally and vertically. More...
 
void resetAngle ()
 Resets the angle which defines horizontal. More...
 
QSharedPointer< LineTraceConfigconfig () const
 
cv::Mat lineImage () const
 Returns the line image. More...
 
cv::Mat generatedLineImage () const
 Generates the line image based on the synthetic line vector. More...
 
virtual QString toString () const override
 Summary of the class. More...
 
- 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< ModuleConfigconfig () const
 

Static Public Member Functions

static void generateLineImage (const QVector< rdf::Line > &hline, const QVector< rdf::Line > &vline, cv::Mat &img, cv::Scalar hCol=cv::Scalar(255), cv::Scalar vCol=cv::Scalar(255), cv::Point2d offset=cv::Point(0, 0))
 

Protected Member Functions

bool checkInput () const override
 
- Protected Member Functions inherited from rdf::Module
QString debugName () const
 

Protected Attributes

cv::Mat mSrcImg
 
cv::Mat mLineImg
 
cv::Mat mMask
 
QVector< rdf::LinehLines
 
QVector< rdf::LinevLines
 
LineFilter mLineFilter
 
- Protected Attributes inherited from rdf::Module
QSharedPointer< ModuleConfigmConfig
 

Detailed Description

Detects Lines in a binary image. The result is a binary image containing all line elements (pixel accurate) as well as all lines as vectors. It is also possible to filter lines according a specified angle.

See also
Module

Constructor & Destructor Documentation

rdf::LineTrace::LineTrace ( const cv::Mat &  img,
const cv::Mat &  mask = cv::Mat() 
)

Initializes a new instance of the LineTrace class.

Parameters
imgThe binary input image.
maskThe mask image.

Member Function Documentation

bool rdf::LineTrace::checkInput ( ) const
overrideprotectedvirtual

checks if all input images are in the specified format.

Implements rdf::Module.

bool rdf::LineTrace::compute ( )
overridevirtual

Computes the binary line image as will as the line vectors.

Returns
True if the lines are computed successfully.

Implements rdf::Module.

QSharedPointer< LineTraceConfig > rdf::LineTrace::config ( ) const
cv::Mat rdf::LineTrace::generatedLineImage ( ) const

Generates the line image based on the synthetic line vector.

Returns
A binary CV_8UC1 image where all line vectors are drawn.
void rdf::LineTrace::generateLineImage ( const QVector< rdf::Line > &  hline,
const QVector< rdf::Line > &  vline,
cv::Mat &  img,
cv::Scalar  hCol = cv::Scalar(255),
cv::Scalar  vCol = cv::Scalar(255),
cv::Point2d  offset = cv::Point(0,0) 
)
static
QVector< rdf::Line > rdf::LineTrace::getHLines ( ) const

Gets the horizontal lines.

Returns
A line vector containing all horizontal lines
QVector< rdf::Line > rdf::LineTrace::getLines ( ) const
QVector< rdf::Line > rdf::LineTrace::getVLines ( ) const

Gets the vertical lines.

Returns
A line vector containing all vertical lines
bool rdf::LineTrace::isEmpty ( ) const
overridevirtual

Determines whether this instance is empty.

Returns
True if src image and mask is empty.

Implements rdf::Module.

cv::Mat rdf::LineTrace::lineImage ( ) const

Returns the line image.

Returns
A binary CV_8UC1 image containing the lines.
void rdf::LineTrace::resetAngle ( )

Resets the angle which defines horizontal.

void rdf::LineTrace::setAngle ( double  angle = std::numeric_limits<double>::infinity())

Sets the angle to filter the lines horizontally and vertically.

Parameters
angleThe angle to define a horizontal line.
QString rdf::LineTrace::toString ( ) const
overridevirtual

Summary of the class.

Returns
A String containing all parameter values.

Reimplemented from rdf::Module.

Member Data Documentation

QVector<rdf::Line> rdf::LineTrace::hLines
protected
LineFilter rdf::LineTrace::mLineFilter
protected
cv::Mat rdf::LineTrace::mLineImg
protected
cv::Mat rdf::LineTrace::mMask
protected
cv::Mat rdf::LineTrace::mSrcImg
protected
QVector<rdf::Line> rdf::LineTrace::vLines
protected

The documentation for this class was generated from the following files: