ReadFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rdf::PixelSet Class Reference

PixelSet stores and manipulates pixel collections. More...

#include <PixelSet.h>

Inheritance diagram for rdf::PixelSet:
Collaboration diagram for rdf::PixelSet:

Public Types

enum  ConnectionMode { connect_delauney, connect_region, connect_end }
 

Public Member Functions

 PixelSet ()
 
 PixelSet (const QVector< QSharedPointer< Pixel > > &set)
 
QSharedPointer< Pixeloperator[] (int idx) const
 
bool contains (const QSharedPointer< Pixel > &pixel) const
 
void merge (const PixelSet &o)
 
void add (const QSharedPointer< Pixel > &pixel)
 
void remove (const QSharedPointer< Pixel > &pixel)
 
QVector< QSharedPointer< Pixel > > pixels () const
 
int size () const
 
QVector< Vector2DpointSet (double offsetAngle=0.0) const
 Returns a point set. The points are sampled along the pixel's ellipses w.r.t the relative angle which is added to the text line orientation. If angle == DBL_MAX or pixel->stats() == NULL, the ellipse centers are sampled instead. More...
 
Polygon convexHull () const
 
Rect boundingBox () const
 
Line fitLine (double offsetAngle=0.0) const
 
Ellipse profileRect () const
 
double orientation (double statMoment=0.5) const
 Computes the sets median orientation. More...
 
double lineSpacing (double statMoment=0.5) const
 
void draw (QPainter &p) const
 
QSharedPointer< TextLinetoTextLine () 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...
 
QString id () const
 Returns the elment's id. More...
 

Static Public Member Functions

static QVector< QSharedPointer
< PixelEdge > > 
connect (const QVector< QSharedPointer< Pixel > > &superPixels, const ConnectionMode &mode=connect_delauney)
 This is a convenience function that connects SuperPixels. It is recommended to use the connector classes respectively. More...
 
static QVector< QSharedPointer
< PixelSet > > 
fromEdges (const QVector< QSharedPointer< PixelEdge > > &edges)
 

Protected Member Functions

Polygon polygon (const QVector< Vector2D > &pts) const
 Returns a poly line along the points defined by angle. If maxAngleThr != -1, points are rejected if the cosine of their enclosing angle is smaller than maxAngleThr. e.g. maxAngleThr = 0 would allow polygon changes of up to 90°. More...
 

Protected Attributes

QVector< QSharedPointer< Pixel > > mSet
 
- Protected Attributes inherited from rdf::BaseElement
QString mId
 

Detailed Description

PixelSet stores and manipulates pixel collections.

See Also
BaseElement

Member Enumeration Documentation

Enumerator
connect_delauney 
connect_region 
connect_end 

Constructor & Destructor Documentation

rdf::PixelSet::PixelSet ( )
rdf::PixelSet::PixelSet ( const QVector< QSharedPointer< Pixel > > &  set)

Member Function Documentation

void rdf::PixelSet::add ( const QSharedPointer< Pixel > &  pixel)
Rect rdf::PixelSet::boundingBox ( ) const
QVector< QSharedPointer< PixelEdge > > rdf::PixelSet::connect ( const QVector< QSharedPointer< Pixel > > &  superPixels,
const ConnectionMode mode = connect_delauney 
)
static

This is a convenience function that connects SuperPixels. It is recommended to use the connector classes respectively.

Parameters
superPixelsThe super pixels.
rectThe bounding rect.
modeThe connection mode.
Returns
bool rdf::PixelSet::contains ( const QSharedPointer< Pixel > &  pixel) const
Polygon rdf::PixelSet::convexHull ( ) const
void rdf::PixelSet::draw ( QPainter &  p) const
Line rdf::PixelSet::fitLine ( double  offsetAngle = 0.0) const
QVector< QSharedPointer< PixelSet > > rdf::PixelSet::fromEdges ( const QVector< QSharedPointer< PixelEdge > > &  edges)
static
double rdf::PixelSet::lineSpacing ( double  statMoment = 0.5) const
void rdf::PixelSet::merge ( const PixelSet o)
QSharedPointer< Pixel > rdf::PixelSet::operator[] ( int  idx) const
double rdf::PixelSet::orientation ( double  statMoment = 0.5) const

Computes the sets median orientation.

Parameters
statMomentif != 0.5 a quartile other than the median is computed.
Returns
The set's median orientation.
QVector< QSharedPointer< Pixel > > rdf::PixelSet::pixels ( ) const
QVector< Vector2D > rdf::PixelSet::pointSet ( double  offsetAngle = 0.0) const

Returns a point set. The points are sampled along the pixel's ellipses w.r.t the relative angle which is added to the text line orientation. If angle == DBL_MAX or pixel->stats() == NULL, the ellipse centers are sampled instead.

Parameters
offsetAngleThe angle which is added to the pixel's local orientation.
Returns
Polygon rdf::PixelSet::polygon ( const QVector< Vector2D > &  pts) const
protected

Returns a poly line along the points defined by angle. If maxAngleThr != -1, points are rejected if the cosine of their enclosing angle is smaller than maxAngleThr. e.g. maxAngleThr = 0 would allow polygon changes of up to 90°.

Parameters
angleThe angle for sampling the ellipses.
maxAngleThrThe maximum angle thresh.
Returns

Returns the convex hull of the PixelSet.

Returns
Ellipse rdf::PixelSet::profileRect ( ) const
void rdf::PixelSet::remove ( const QSharedPointer< Pixel > &  pixel)
int rdf::PixelSet::size ( ) const
QSharedPointer< TextLine > rdf::PixelSet::toTextLine ( ) const

Member Data Documentation

QVector<QSharedPointer<Pixel> > rdf::PixelSet::mSet
protected

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