Name | blobs() | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Examples | import hypermedia.video.*; OpenCV opencv; void setup() { size( 640, 480 ); // open video stream opencv = new OpenCV( this ); opencv.capture( 640, 480 ); } void draw() { background(192); opencv.read(); // grab frame from camera opencv.threshold(80); // set black & white threshold // find blobs Blob[] blobs = opencv.blobs( 10, width*height/2, 100, true, OpenCV.MAX_VERTICES*4 ); // draw blob results for( int i=0; i<blobs.length; i++ ) { beginShape(); for( int j=0; j<blobs[i].points.length; j++ ) { vertex( blobs[i].points[j].x, blobs[i].points[j].y ); } endShape(CLOSE); } } |
||||||||||
Description | Blob and contour detection.
This function looks for contours within the image, returning a list of When searching for blobs, you must define the minimum and maximum size in pixels. For example, if you want to limit blobs to no larger than half the Region Of Interest, pass Blobs are returned in order from largest to smallest.
The optional Careful! This function will damage the current buffered image while searching for contours. If you want to do any subsequent work with this image, you will need to call the |
||||||||||
Syntax | blobs(minArea, maxArea, maxBlobs, findHoles); |
||||||||||
Parameters |
|
||||||||||
Return | Blob[] | ||||||||||
Usage | Application | ||||||||||
Related | Blob restore() MAX_VERTICES |