Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ofDrawCircle(ofGetWidth()/2, ofGetHeight()/2, amplitud);
- grayBg.draw(20,20);
- grayDiff.draw(20,300);
- // or, instead we can draw each blob individually from the blobs vector,
- // this is how to get access to them:
- for (int i = 0; i < contourFinder.nBlobs; i++){
- contourFinder.blobs[i].draw(20,600);
- // draw over the centroid if the blob is a hole
- ofSetColor(255);
- if(contourFinder.blobs[i].hole){
- ofDrawBitmapString("hole",
- contourFinder.blobs[i].boundingRect.getCenter().x + 20,
- contourFinder.blobs[i].boundingRect.getCenter().y + 600);
- }
- }
- // finally, a report:
- ofSetHexColor(0xffffff);
- stringstream reportStr;
- reportStr << "bg subtraction and blob detection" << endl
- << "press ' ' to capture bg" << endl
- << "threshold " << threshold << " (press: +/-)" << endl
- << "num blobs found " << contourFinder.nBlobs << ", fps: " << ofGetFrameRate();
- ofDrawBitmapString(reportStr.str(), 20, 600);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement