diff options
Diffstat (limited to 'gui/src/ofApp.cpp')
| -rw-r--r-- | gui/src/ofApp.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gui/src/ofApp.cpp b/gui/src/ofApp.cpp index 56d3792..6227686 100644 --- a/gui/src/ofApp.cpp +++ b/gui/src/ofApp.cpp @@ -732,8 +732,9 @@ void ofApp::drawOutput(ofEventArgs & args){ grayImage.clear(); } grayImage=colorImg; - grayImage.threshold(contour_threshold); - contourFinder.findContours(grayImage, 20, (340*240)/3, 10, true); + //grayImage.threshold(contour_threshold); + grayImage.adaptiveThreshold(grayImage.getWidth()/8, contour_threshold,false,true); + contourFinder.findContours(grayImage, 20, (grayImage.getWidth()*grayImage.getHeight())/3, 10, true); for (int i = 0; i < contourFinder.nBlobs; i++){ colourPolyline shape; for (auto& point:contourFinder.blobs[i].pts){ @@ -787,7 +788,7 @@ void ofApp::drawOutput(ofEventArgs & args){ if (contour_useColour){ vector<colourPolyline> newPolys; for (auto p: polyOutput){ - newPolys.push_back(colourPolyline((ofPolyline)p,ofColor(laser_R,laser_G,laser_B))); + newPolys.push_back(colourPolyline((ofPolyline)p,ofColor(laser_R,laser_G,laser_B))) ; } polyOutput=newPolys; } |
