ofDocsdocumentation addons ofxOpenCv ofxCvBlob

ofxCvBlob

ofxCvBlob represents an area identified by the OpenCV plug-in as being a contiguous object in the scene. It's most often stored within a contrountFind instance and populated by a call to findContours().

In the image below you can see two blobs detected in the grayscale image:

blobs


draw( ... )

void draw(float x, float y)

This method draws the blob to the screen with the upper-left corner located at the point specified by the x and y values.


ofxCvBlob( )

ofxCvBlob()

Constructor.


Variables

float area

Returns the area of the blob.

ofRectangle boundingRect

an ofRectangle instance that can be drawn to the screen and that shows the height and width of the blob. This can be helpful to determine large regions of interest, or it can lead to some inaccurate results depending on the shape of your object. For instance, a squarish shape will be well represented by a rectangle, whereas a long thin shape with an angle in the middle will not.

ofPoint centroid

This is an ofPoint instance with its x and y positions set at the center of the boundaries of the blob.

bool hole

This is a Boolean value that indicates whether the blob contains a whole. This is also dependent on whether the call to findContours() in ofxContourFinder has the findHoles parameter set to true.

float length

Returns the perimeter of the blob.

int nPts

This is an int that represents the number of points that are contained within the contour.