diff options
| author | Tim Redfern <tim@getdrop.com> | 2018-11-30 01:38:24 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2018-11-30 01:38:24 +0000 |
| commit | 282b01e34b03af2942c4a4e30c17349cb0ec3972 (patch) | |
| tree | 50d92baf1a064e73eff074373e7c58bc112b99ff /gui | |
| parent | b13a6be243a9c6abb3e6aa906ff033f81a5f209f (diff) | |
try adaptive filter
Diffstat (limited to 'gui')
| -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; } |
