ReadFramework
rdf::Pixel Class Reference

This class represents a single instance of super pixels which are needed for the layout analysis. More...

#include <Pixel.h>

Inheritance diagram for rdf::Pixel:
Collaboration diagram for rdf::Pixel:

Public Types

enum  mDrawFlags {
  draw_none = 0x00, draw_ellipse = 0x01, draw_stats = 0x02, draw_center = 0x04,
  draw_id = 0x08, draw_label_colors = 0x10, draw_tab_stops = 0x20, draw_all = 0x3f
}
 
typedef Flags< mDrawFlagsDrawFlags
 

Public Member Functions

 Pixel ()
 
 Pixel (const Ellipse &ellipse, const Rect &bbox=Rect(), const QString &id=QString())
 
bool isNull () const
 
Vector2D center () const
 
Rect bbox () const
 
Vector2D size () const
 
double angle () const
 
Ellipse ellipse () const
 
void scale (double factor) override
 
void move (const Vector2D &vec)
 
void addStats (const QSharedPointer< PixelStats > &stats)
 
QSharedPointer< PixelStatsstats (int idx=-1) const
 
void setTabStop (const PixelTabStop &tabStop)
 
PixelTabStop tabStop () const
 Returns tab stop statistics or NULL if tab stops are not computed. PixelTabStop stores if the Pixel is a tab stop (left/right) candidate or not. More...
 
void setLabel (const QSharedPointer< PixelLabel > &label)
 
QSharedPointer< PixelLabellabel () const
 
void setPyramidLevel (int level)
 
int pyramidLevel () const
 
cv::KeyPoint toKeyPoint () const
 
void setValue (double value)
 
double value () const
 
cv::Mat toBinaryMask (const Rect &r) const
 
void draw (QPainter &p, double alpha=0.3, const DrawFlags &df=DrawFlags()|draw_ellipse|draw_label_colors) const
 
- Public Member Functions inherited from rdf::BaseElement
 BaseElement (const QString &id=QString())
 This class keeps an ID to keep track of transformed elements during a processing chain. You can e.g. generate Pixel elements from MserBlobs. After filtering, processing etc. you can map back to the (pixel accurate) MserBlob using this ID. More...
 
void setId (const QString &id)
 Sets the (preferably unique) ID. If no ID is set, a unqiue ID is generated and assigned. More...
 
QString id () const
 Returns the elment's id. More...
 
virtual QString toString () const
 

Protected Attributes

bool mIsNull = true
 
Ellipse mEllipse
 
Rect mBBox
 
QVector< QSharedPointer< PixelStats > > mStats
 
PixelTabStop mTabStop
 
QSharedPointer< PixelLabelmLabel = QSharedPointer<PixelLabel>::create()
 
double mValue = 0.0
 
int mPyramidLevel = 0
 
- Protected Attributes inherited from rdf::BaseElement
QString mId
 

Detailed Description

This class represents a single instance of super pixels which are needed for the layout analysis.

See also
BaseElement

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
draw_none 
draw_ellipse 
draw_stats 
draw_center 
draw_id 
draw_label_colors 
draw_tab_stops 
draw_all 

Constructor & Destructor Documentation

rdf::Pixel::Pixel ( )
rdf::Pixel::Pixel ( const Ellipse ellipse,
const Rect bbox = Rect(),
const QString &  id = QString() 
)

Member Function Documentation

void rdf::Pixel::addStats ( const QSharedPointer< PixelStats > &  stats)

Here is the caller graph for this function:

double rdf::Pixel::angle ( ) const

Here is the caller graph for this function:

Rect rdf::Pixel::bbox ( ) const
inline

Here is the caller graph for this function:

Vector2D rdf::Pixel::center ( ) const
inline

Here is the caller graph for this function:

void rdf::Pixel::draw ( QPainter &  p,
double  alpha = 0.3,
const DrawFlags df = DrawFlags() |  draw_ellipse | draw_label_colors 
) const
Ellipse rdf::Pixel::ellipse ( ) const

Here is the caller graph for this function:

bool rdf::Pixel::isNull ( ) const

Here is the caller graph for this function:

QSharedPointer< PixelLabel > rdf::Pixel::label ( ) const

Here is the caller graph for this function:

void rdf::Pixel::move ( const Vector2D vec)
int rdf::Pixel::pyramidLevel ( ) const
void rdf::Pixel::scale ( double  factor)
overridevirtual

Reimplemented from rdf::BaseElement.

void rdf::Pixel::setLabel ( const QSharedPointer< PixelLabel > &  label)
void rdf::Pixel::setPyramidLevel ( int  level)
void rdf::Pixel::setTabStop ( const PixelTabStop tabStop)
void rdf::Pixel::setValue ( double  value)
Vector2D rdf::Pixel::size ( ) const
QSharedPointer< PixelStats > rdf::Pixel::stats ( int  idx = -1) const

Here is the caller graph for this function:

PixelTabStop rdf::Pixel::tabStop ( ) const

Returns tab stop statistics or NULL if tab stops are not computed. PixelTabStop stores if the Pixel is a tab stop (left/right) candidate or not.

Returns
Tab stop statistics.

Here is the caller graph for this function:

cv::Mat rdf::Pixel::toBinaryMask ( const Rect r) const
cv::KeyPoint rdf::Pixel::toKeyPoint ( ) const
double rdf::Pixel::value ( ) const

Here is the caller graph for this function:

Member Data Documentation

Rect rdf::Pixel::mBBox
protected
Ellipse rdf::Pixel::mEllipse
protected
bool rdf::Pixel::mIsNull = true
protected
QSharedPointer<PixelLabel> rdf::Pixel::mLabel = QSharedPointer<PixelLabel>::create()
protected
int rdf::Pixel::mPyramidLevel = 0
protected
QVector<QSharedPointer<PixelStats> > rdf::Pixel::mStats
protected
PixelTabStop rdf::Pixel::mTabStop
protected
double rdf::Pixel::mValue = 0.0
protected

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