Read@CVL
rdf::Blob Class Reference

A class that defines a single blob within an image. More...

#include <Blobs.h>

Public Member Functions

 Blob ()
 Initializes a new instance of the Blob class. More...
 
 Blob (const QVector< cv::Point > &outerC, const QVector< QVector< cv::Point > > &innerC)
 Initializes a new instance of the Blob class. More...
 
bool isEmpty () const
 Determines whether this instance is empty. More...
 
void setBlob (const QVector< cv::Point > &outerC, const QVector< QVector< cv::Point > > &innerC)
 Sets the blob. More...
 
QVector< cv::Point > outerContour () const
 Returns the outer contour. More...
 
QVector< QVector< cv::Point > > innerContours () const
 Returns the inner contours. More...
 
QVector< cv::Vec4i > hierarchy () const
 Calculates the hierarchy for the blob such that it can be used with openCV functions. More...
 
float blobOrientation () const
 The blobs orientation based on moments. More...
 
bool drawBlob (cv::Mat &imgSrc, cv::Scalar color=cv::Scalar(255, 255, 255), int maxLevel=1) const
 Draws the Blob. More...
 

Protected Attributes

QVector< cv::Point > mOuterContour
 
QVector< QVector< cv::Point > > mInnerContours
 

Detailed Description

A class that defines a single blob within an image.

Constructor & Destructor Documentation

rdf::Blob::Blob ( )

Initializes a new instance of the Blob class.

rdf::Blob::Blob ( const QVector< cv::Point > &  outerC,
const QVector< QVector< cv::Point > > &  innerC 
)

Initializes a new instance of the Blob class.

Parameters
outerCThe outer contour of the blob.
innerCThe inner contours of the blob (can be more than one).

Member Function Documentation

float rdf::Blob::blobOrientation ( ) const

The blobs orientation based on moments.

Returns
The orientation of the blob in rad.
bool rdf::Blob::drawBlob ( cv::Mat &  imgSrc,
cv::Scalar  color = cv::Scalar(255, 255, 255),
int  maxLevel = 1 
) const

Draws the Blob.

Parameters
imgSrcThe img source where the blob is drawn.
colorThe color of the blob.
Returns
True if the blob is drawn.
QVector< cv::Vec4i > rdf::Blob::hierarchy ( ) const

Calculates the hierarchy for the blob such that it can be used with openCV functions.

Returns
The OpenCV hierarchy.
QVector< QVector< cv::Point > > rdf::Blob::innerContours ( ) const

Returns the inner contours.

Returns
The inner contours.
bool rdf::Blob::isEmpty ( ) const

Determines whether this instance is empty.

Returns
True if emtpy.
QVector< cv::Point > rdf::Blob::outerContour ( ) const

Returns the outer contour.

Returns
The outer contour.
void rdf::Blob::setBlob ( const QVector< cv::Point > &  outerC,
const QVector< QVector< cv::Point > > &  innerC 
)

Sets the blob.

Parameters
outerCThe outer contour.
innerCThe inner contours.

Member Data Documentation

QVector<QVector<cv::Point> > rdf::Blob::mInnerContours
protected
QVector<cv::Point> rdf::Blob::mOuterContour
protected

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