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:
void ofxCvBlob::draw(float x=0, float y=0)
This method draws the blob to the screen with the upper-left corner located at the point specified by the x and y values.
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.
This is an ofPoint instance with its x and y positions set at the center of the boundaries of the blob.
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.
This is an int that represents the number of points that are contained within the contour.
vector< ofPoint > pts
vector< ofPoint > ofxCvBlob::pts
This is a vector of ofPoint objects that represent the contour of the blob. This is different from the bounding rectangle. It's listing the different points around the edge of the blob. The bounding rectangle is a rectangle around the extreme points of the blob.
Thursday, 16 May 2013 14:01:33 UTC