diff --git a/src/AbstractAnalysis.cpp b/src/AbstractAnalysis.cpp index 15e3056..f0b83ee 100644 --- a/src/AbstractAnalysis.cpp +++ b/src/AbstractAnalysis.cpp @@ -22,9 +22,11 @@ void AbstractAnalysis::do_synthesize() { if(_state == STATE_STOP) goto exit; _state = STATE_DISPLAY_RESULTS; displayresults(); + cleanup(); } exit: + cleanup(); ofNotifyEvent(_synthesize_cb, _name); } diff --git a/src/AbstractAnalysis.h b/src/AbstractAnalysis.h index ef4d396..298f9a6 100755 --- a/src/AbstractAnalysis.h +++ b/src/AbstractAnalysis.h @@ -48,6 +48,10 @@ protected: // display the results from disk virtual void displayresults() = 0; + + // display the results from disk + virtual void cleanup() {;} + public: string _name; diff --git a/src/IResponseAnalysis.cpp b/src/IResponseAnalysis.cpp index 1119681..a3beb30 100755 --- a/src/IResponseAnalysis.cpp +++ b/src/IResponseAnalysis.cpp @@ -184,7 +184,11 @@ void IResponseAnalysis::synthesise() cvConvertorImage.setFromGrayscalePlanarImages(cvGrayDiff1,cvGrayDiff1,cvGrayDiff1); saveImageSynthesis(file_name, &cvConvertorImage, OF_IMAGE_GRAYSCALE); + _synth_save_cnt++; + + + } } } diff --git a/src/RelaxRateAnalysis.cpp b/src/RelaxRateAnalysis.cpp index 1f87ec7..f84f897 100755 --- a/src/RelaxRateAnalysis.cpp +++ b/src/RelaxRateAnalysis.cpp @@ -75,6 +75,8 @@ void RelaxRateAnalysis::setup(int camWidth, int camHeight) image4.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h, OF_IMAGE_COLOR); image5.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h, OF_IMAGE_COLOR); + + //cout << "RefractiveIndex::_vid_w " << RefractiveIndex::_vid_w << endl; //cout << "RefractiveIndex::_vid_h " << RefractiveIndex::_vid_h << endl; @@ -133,7 +135,29 @@ void RelaxRateAnalysis::synthesise() //cout << "IResponseAnalysis::saving synthesis...\n"; if(_state == STATE_STOP) return; - cvContourFinderVect.clear(); + cvContourFinderVect.clear(); + + image1.clear(); + image2.clear(); + image3.clear(); + image4.clear(); + image5.clear(); + + // images use for drawing the synthesized files to the screen /// + image1.setUseTexture(false); // the non texture image that is needed to first load the image + image2.setUseTexture(true); // the image that needs to get written to the screen which takes the content of image1 + + // images used for re-loading and saving out the synthesized files /// + image3.setUseTexture(false); + image4.setUseTexture(false); + image5.setUseTexture(false); + + image1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h, OF_IMAGE_COLOR); + //image2.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h, OF_IMAGE_COLOR); + image3.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h, OF_IMAGE_COLOR); + image4.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h, OF_IMAGE_COLOR); + image5.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h, OF_IMAGE_COLOR); + for(float i=1;i<_saved_filenames_analysis.size();i++){ @@ -166,11 +190,16 @@ void RelaxRateAnalysis::synthesise() void RelaxRateAnalysis::displayresults() { - cvContourFinderVectDisplay.clear(); + //cvContourFinderVectDisplay.clear(); + clearcfindervectdisplay(); for(int i=1;i