Revert 884e55abd48d4efa0c6bfe06469e7b1abea51c14^..HEAD
This commit is contained in:
parent
884e55abd4
commit
e43b78cc5a
@ -22,9 +22,11 @@ void AbstractAnalysis::do_synthesize() {
|
|||||||
if(_state == STATE_STOP) goto exit;
|
if(_state == STATE_STOP) goto exit;
|
||||||
_state = STATE_DISPLAY_RESULTS;
|
_state = STATE_DISPLAY_RESULTS;
|
||||||
displayresults();
|
displayresults();
|
||||||
|
cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
cleanup();
|
||||||
ofNotifyEvent(_synthesize_cb, _name);
|
ofNotifyEvent(_synthesize_cb, _name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -49,6 +49,10 @@ protected:
|
|||||||
// display the results from disk
|
// display the results from disk
|
||||||
virtual void displayresults() = 0;
|
virtual void displayresults() = 0;
|
||||||
|
|
||||||
|
// display the results from disk
|
||||||
|
virtual void cleanup() {;}
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
string _name;
|
string _name;
|
||||||
|
|
||||||
|
|||||||
@ -184,7 +184,11 @@ void IResponseAnalysis::synthesise()
|
|||||||
cvConvertorImage.setFromGrayscalePlanarImages(cvGrayDiff1,cvGrayDiff1,cvGrayDiff1);
|
cvConvertorImage.setFromGrayscalePlanarImages(cvGrayDiff1,cvGrayDiff1,cvGrayDiff1);
|
||||||
|
|
||||||
saveImageSynthesis(file_name, &cvConvertorImage, OF_IMAGE_GRAYSCALE);
|
saveImageSynthesis(file_name, &cvConvertorImage, OF_IMAGE_GRAYSCALE);
|
||||||
|
|
||||||
_synth_save_cnt++;
|
_synth_save_cnt++;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -75,6 +75,8 @@ void RelaxRateAnalysis::setup(int camWidth, int camHeight)
|
|||||||
image4.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);
|
image5.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h, OF_IMAGE_COLOR);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//cout << "RefractiveIndex::_vid_w " << RefractiveIndex::_vid_w << endl;
|
//cout << "RefractiveIndex::_vid_w " << RefractiveIndex::_vid_w << endl;
|
||||||
//cout << "RefractiveIndex::_vid_h " << RefractiveIndex::_vid_h << endl;
|
//cout << "RefractiveIndex::_vid_h " << RefractiveIndex::_vid_h << endl;
|
||||||
|
|
||||||
@ -135,6 +137,28 @@ void RelaxRateAnalysis::synthesise()
|
|||||||
|
|
||||||
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++){
|
for(float i=1;i<_saved_filenames_analysis.size();i++){
|
||||||
|
|
||||||
if(_state == STATE_STOP) return;
|
if(_state == STATE_STOP) return;
|
||||||
@ -166,11 +190,16 @@ void RelaxRateAnalysis::synthesise()
|
|||||||
void RelaxRateAnalysis::displayresults()
|
void RelaxRateAnalysis::displayresults()
|
||||||
{
|
{
|
||||||
|
|
||||||
cvContourFinderVectDisplay.clear();
|
//cvContourFinderVectDisplay.clear();
|
||||||
|
clearcfindervectdisplay();
|
||||||
|
|
||||||
for(int i=1;i<cvContourFinderVect.size();i++){
|
for(int i=1;i<cvContourFinderVect.size();i++){
|
||||||
|
|
||||||
if(_state == STATE_STOP) return;
|
if(_state == STATE_STOP){
|
||||||
|
clearcfindervectdisplay();
|
||||||
|
clearcfindervect();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//cout << "_saved_filenames_analysis[i] - " << _saved_filenames_synthesis[i] << endl;
|
//cout << "_saved_filenames_analysis[i] - " << _saved_filenames_synthesis[i] << endl;
|
||||||
@ -187,6 +216,14 @@ void RelaxRateAnalysis::displayresults()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearcfindervectdisplay();
|
||||||
|
clearcfindervect();
|
||||||
|
|
||||||
|
|
||||||
|
//cvContourFinderVectDisplay.clear();
|
||||||
|
//cvContourFinderVect.clear();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -198,6 +235,7 @@ void RelaxRateAnalysis::draw()
|
|||||||
case STATE_ACQUIRING:
|
case STATE_ACQUIRING:
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if (_frame_cnt < _frame_cnt_max)
|
if (_frame_cnt < _frame_cnt_max)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -227,6 +265,7 @@ void RelaxRateAnalysis::draw()
|
|||||||
|
|
||||||
case STATE_SYNTHESISING:
|
case STATE_SYNTHESISING:
|
||||||
{
|
{
|
||||||
|
|
||||||
// display animation of something while the synthesis in on-going...
|
// display animation of something while the synthesis in on-going...
|
||||||
|
|
||||||
//cout << "RelaxRateAnalysis = STATE_SYNTHESISING...\n";
|
//cout << "RelaxRateAnalysis = STATE_SYNTHESISING...\n";
|
||||||
@ -335,6 +374,15 @@ void RelaxRateAnalysis::draw()
|
|||||||
|
|
||||||
// display results of the synthesis
|
// display results of the synthesis
|
||||||
_RUN_DONE = true;
|
_RUN_DONE = true;
|
||||||
|
|
||||||
|
cvColorImage1.clear();
|
||||||
|
cvGrayImage1.clear();
|
||||||
|
cvGrayDiff1.clear();
|
||||||
|
|
||||||
|
cvColorImage2.clear();
|
||||||
|
cvGrayImage2.clear();
|
||||||
|
cvGrayDiff2.clear();
|
||||||
|
image2.clear();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -356,3 +404,28 @@ void RelaxRateAnalysis::save_cb(Timer& timer)
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RelaxRateAnalysis::cleanup()
|
||||||
|
{
|
||||||
|
image1.clear();
|
||||||
|
image2.clear();
|
||||||
|
image3.clear();
|
||||||
|
image4.clear();
|
||||||
|
image5.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RelaxRateAnalysis::clearcfindervect()
|
||||||
|
{
|
||||||
|
for(int i = 0; i < cvContourFinderVect.size(); i++) {
|
||||||
|
rfiCvContourFinder* f = cvContourFinderVect[i];
|
||||||
|
delete f;
|
||||||
|
}
|
||||||
|
cvContourFinderVect.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RelaxRateAnalysis::clearcfindervectdisplay()
|
||||||
|
{
|
||||||
|
cvContourFinderVectDisplay.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,7 @@ public:
|
|||||||
void acquire();
|
void acquire();
|
||||||
void synthesise();
|
void synthesise();
|
||||||
void displayresults();
|
void displayresults();
|
||||||
|
void cleanup();
|
||||||
|
|
||||||
void draw();
|
void draw();
|
||||||
|
|
||||||
@ -30,6 +31,9 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
void clearcfindervect();
|
||||||
|
void clearcfindervectdisplay();
|
||||||
|
|
||||||
bool _RUN_DONE;
|
bool _RUN_DONE;
|
||||||
float _flip, _level;
|
float _flip, _level;
|
||||||
int _run_cnt, _save_cnt, _synth_save_cnt, _anim_cnt;
|
int _run_cnt, _save_cnt, _synth_save_cnt, _anim_cnt;
|
||||||
|
|||||||
@ -439,6 +439,9 @@ void ShadowScapesAnalysis::draw()
|
|||||||
|
|
||||||
// display results of the synthesis
|
// display results of the synthesis
|
||||||
_RUN_DONE = true;
|
_RUN_DONE = true;
|
||||||
|
|
||||||
|
// clear allocated memory...?
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user