summaryrefslogtreecommitdiff
path: root/gui/src
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2018-02-03 16:47:39 +0000
committerTim Redfern <tim@getdrop.com>2018-02-03 16:47:39 +0000
commit5fb4665df87d877c5463d0a0e474f434d8844234 (patch)
tree2121b5999e6cb420876b9724f88c22ab2cd6286b /gui/src
parentc8e23f287328fe1fefbfb039bea31ef09ce1cd3d (diff)
reallocate openCv for change in res
Diffstat (limited to 'gui/src')
-rw-r--r--gui/src/ofApp.cpp5
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++){