Loading src/BlobFinder.cpp +23 −4 Original line number Diff line number Diff line Loading @@ -207,6 +207,26 @@ void BlobFinder::loadMask() { maskFbo.end(); } void BlobFinder::filterTrailingPixels() { filteredImage = grayImage; // close filteredImage.dilate(); filteredImage.erode(); // open filteredImage.erode(); filteredImage.dilate(); // close filteredImage.dilate(); filteredImage.erode(); // open filteredImage.erode(); filteredImage.dilate(); } void BlobFinder::update(){ ofColor white = ofColor::white; ofColor black = ofColor::black; Loading @@ -223,7 +243,7 @@ void BlobFinder::update(){ minID = (blobEvents[e].mID >= minID) ? blobEvents[e].mID + 1 : minID; } if (true || useMask.get()) { if (useMask.get()) { fbo.begin(); // Cleaning everthing with alpha mask on 0 in order to make it transparent for default ofClear(0, 0, 0, 0); Loading @@ -246,8 +266,7 @@ void BlobFinder::update(){ // load grayscale captured depth image from the color source grayImage.setFromColorImage(colorImg); //grayImage.blurHeavily(); filterTrailingPixels(); ofPixelsRef blobRefPixls = blobRef.getPixels(); Loading Loading @@ -283,7 +302,7 @@ void BlobFinder::update(){ detectedHeads.clear(); contourFinder.findContours(grayImage, minBlobSize, maxBlobSize, countBlob.get(), false); contourFinder.findContours(filteredImage, minBlobSize, maxBlobSize, countBlob.get(), false); for (int i = 0; i < contourFinder.nBlobs; i++){ ofRectangle bounds = contourFinder.blobs[i].boundingRect; Loading src/BlobFinder.h +2 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ public: void loadMask(); void saveMask(); void filterTrailingPixels(); void update(); bool hasParamUpdate(); Loading Loading @@ -91,6 +92,7 @@ public: ofxCvGrayscaleImage blobRef; // body blob reference image ofxCvGrayscaleImage grayImage; // grayscale depth image ofxCvGrayscaleImage filteredImage; // grayscale depth image with trailing pixels filtered out ofxCvGrayscaleImage grayEyeLevel; // the eyelevel thresholded image ofxCvGrayscaleImage grayThreshFar; // the far thresholded image Loading src/ofApp.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -420,7 +420,7 @@ void ofApp::drawCapturePointCloud(bool _mask) { } else { shader.setUniform1i("mask", 0); glPointSize(6 * 2); glPointSize(2); } shader.setUniform1f("lowerLimit", lowerLimit); shader.setUniform1f("upperLimit", upperLimit); Loading Loading
src/BlobFinder.cpp +23 −4 Original line number Diff line number Diff line Loading @@ -207,6 +207,26 @@ void BlobFinder::loadMask() { maskFbo.end(); } void BlobFinder::filterTrailingPixels() { filteredImage = grayImage; // close filteredImage.dilate(); filteredImage.erode(); // open filteredImage.erode(); filteredImage.dilate(); // close filteredImage.dilate(); filteredImage.erode(); // open filteredImage.erode(); filteredImage.dilate(); } void BlobFinder::update(){ ofColor white = ofColor::white; ofColor black = ofColor::black; Loading @@ -223,7 +243,7 @@ void BlobFinder::update(){ minID = (blobEvents[e].mID >= minID) ? blobEvents[e].mID + 1 : minID; } if (true || useMask.get()) { if (useMask.get()) { fbo.begin(); // Cleaning everthing with alpha mask on 0 in order to make it transparent for default ofClear(0, 0, 0, 0); Loading @@ -246,8 +266,7 @@ void BlobFinder::update(){ // load grayscale captured depth image from the color source grayImage.setFromColorImage(colorImg); //grayImage.blurHeavily(); filterTrailingPixels(); ofPixelsRef blobRefPixls = blobRef.getPixels(); Loading Loading @@ -283,7 +302,7 @@ void BlobFinder::update(){ detectedHeads.clear(); contourFinder.findContours(grayImage, minBlobSize, maxBlobSize, countBlob.get(), false); contourFinder.findContours(filteredImage, minBlobSize, maxBlobSize, countBlob.get(), false); for (int i = 0; i < contourFinder.nBlobs; i++){ ofRectangle bounds = contourFinder.blobs[i].boundingRect; Loading
src/BlobFinder.h +2 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ public: void loadMask(); void saveMask(); void filterTrailingPixels(); void update(); bool hasParamUpdate(); Loading Loading @@ -91,6 +92,7 @@ public: ofxCvGrayscaleImage blobRef; // body blob reference image ofxCvGrayscaleImage grayImage; // grayscale depth image ofxCvGrayscaleImage filteredImage; // grayscale depth image with trailing pixels filtered out ofxCvGrayscaleImage grayEyeLevel; // the eyelevel thresholded image ofxCvGrayscaleImage grayThreshFar; // the far thresholded image Loading
src/ofApp.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -420,7 +420,7 @@ void ofApp::drawCapturePointCloud(bool _mask) { } else { shader.setUniform1i("mask", 0); glPointSize(6 * 2); glPointSize(2); } shader.setUniform1f("lowerLimit", lowerLimit); shader.setUniform1f("upperLimit", upperLimit); Loading