diff options
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/src/ofApp.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gui/src/ofApp.cpp b/gui/src/ofApp.cpp index 05314d1..48f9fc0 100644 --- a/gui/src/ofApp.cpp +++ b/gui/src/ofApp.cpp @@ -422,7 +422,10 @@ void ofApp::drawOutput(ofEventArgs & args){ if (movie.isLoaded()){ ofPoint scale=ofPoint(outputWindowSize.x/movie.getWidth(),outputWindowSize.y/movie.getHeight()); colorImg.setFromPixels(movie.getPixels()); - grayImage = colorImg; + if (grayImage.getWidth()!=colorImg.getWidth()||grayImage.getHeight()!=colorImg.getHeight()){ + grayImage.clear(); + } + grayImage=colorImg; grayImage.threshold(contour_threshold); contourFinder.findContours(grayImage, 20, (340*240)/3, 10, true); for (int i = 0; i < contourFinder.nBlobs; i++){ |
