ReadFramework
rdf::TextLineSet Class Reference

#include <PixelSet.h>

Inheritance diagram for rdf::TextLineSet:
Collaboration diagram for rdf::TextLineSet:

Public Member Functions

 TextLineSet ()
 
 TextLineSet (const QVector< QSharedPointer< Pixel > > &set)
 
void add (const QSharedPointer< Pixel > &pixel) override
 
void remove (const QSharedPointer< Pixel > &pixel) override
 
void append (const QVector< QSharedPointer< Pixel > > &set) override
 
void scale (double factor) override
 
void update ()
 
void draw (QPainter &p, const DrawFlags &options=PixelSet::draw_poly, const Pixel::DrawFlags &pixelOptions=Pixel::draw_ellipse) const override
 
Line line () const
 
double error () const
 
double computeError (const QVector< Vector2D > &pts) const
 
double density () const
 Returns the text line density. The density is defined as # components/baseline length. More...
 
- Public Member Functions inherited from rdf::PixelSet
 PixelSet ()
 
 PixelSet (const QVector< QSharedPointer< Pixel > > &set)
 
void operator+= (const PixelSet &set)
 
QSharedPointer< Pixeloperator[] (int idx) const
 
void operator<< (const QSharedPointer< Pixel > &pixel)
 
void operator<< (const PixelSet &set)
 
bool isEmpty () const
 
bool contains (const QSharedPointer< Pixel > &pixel) const
 
virtual void filterDuplicates (int eps=5)
 
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...
 
QVector< Vector2Dcenters () const
 
Polygon convexHull () const
 
Rect boundingBox () const
 
Line fitLine (double offsetAngle=0.0) const
 
Ellipse fitEllipse () const
 
Vector2D center () const
 
Vector2D meanCenter () const
 
double orientation (double statMoment=0.5) const
 Computes the sets median orientation. More...
 
double lineSpacing (double statMoment=0.5) const
 
double area () const
 
QSharedPointer< Pixelfind (const QString &id) const
 Returns the pixel having the id specified. If no pixel with this ID exists, a null pointer is returned. More...
 
QSharedPointer< TextLinetoTextLine () const
 
QVector< PixelSetsplitScales () const
 
virtual QString toString () const override
 
- 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...
 

Protected Member Functions

void updateLine ()
 
- Protected Member Functions inherited from rdf::PixelSet
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

Line mLine
 
double mLineErr = DBL_MAX
 
- Protected Attributes inherited from rdf::PixelSet
QVector< QSharedPointer< Pixel > > mSet
 
- Protected Attributes inherited from rdf::BaseElement
QString mId
 

Additional Inherited Members

- Public Types inherited from rdf::PixelSet
enum  ConnectionMode { connect_Delaunay, connect_region, connect_end }
 
enum  mDrawFlags {
  draw_nothing = 0x0, draw_pixels = 0x1, draw_poly = 0x2, draw_rect = 0x4,
  draw_end
}
 
typedef Flags< mDrawFlagsDrawFlags
 
- Static Public Member Functions inherited from rdf::PixelSet
static QVector< QSharedPointer< PixelEdge > > connect (const QVector< QSharedPointer< Pixel > > &superPixels, const ConnectionMode &mode=connect_Delaunay)
 This is a convenience function that connects SuperPixels. It is recommended to use the connector classes respectively. More...
 
static QVector< PixelSetfromEdges (const QVector< QSharedPointer< PixelEdge > > &edges)
 
static PixelSet merge (const QVector< PixelSet > &sets)
 Merges multiple pixel sets to one set. More...
 

Constructor & Destructor Documentation

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

Member Function Documentation

void rdf::TextLineSet::add ( const QSharedPointer< Pixel > &  pixel)
overridevirtual

Reimplemented from rdf::PixelSet.

void rdf::TextLineSet::append ( const QVector< QSharedPointer< Pixel > > &  set)
overridevirtual

Reimplemented from rdf::PixelSet.

Here is the caller graph for this function:

double rdf::TextLineSet::computeError ( const QVector< Vector2D > &  pts) const
double rdf::TextLineSet::density ( ) const

Returns the text line density. The density is defined as # components/baseline length.

Returns
void rdf::TextLineSet::draw ( QPainter &  p,
const DrawFlags options = PixelSet::draw_poly,
const Pixel::DrawFlags pixelOptions = Pixel::draw_ellipse 
) const
overridevirtual

Reimplemented from rdf::PixelSet.

double rdf::TextLineSet::error ( ) const
Line rdf::TextLineSet::line ( ) const
void rdf::TextLineSet::remove ( const QSharedPointer< Pixel > &  pixel)
overridevirtual

Reimplemented from rdf::PixelSet.

void rdf::TextLineSet::scale ( double  factor)
overridevirtual

Reimplemented from rdf::PixelSet.

void rdf::TextLineSet::update ( )
void rdf::TextLineSet::updateLine ( )
protected

Member Data Documentation

Line rdf::TextLineSet::mLine
protected
double rdf::TextLineSet::mLineErr = DBL_MAX
protected

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