put in image.clear() and ofCvImage.clear() statements before allocation and after use of these
trying to solve windows (mostly) crash, which seems to stem from "OF_WARNING: in allocate, reallocating a ofxCvImage" - hopefully this is the one!
This commit is contained in:
parent
38ec4da627
commit
7a7614d02d
@ -98,16 +98,19 @@ void AbstractAnalysis::create_dir_allocate_images()
|
||||
//////////////////////////////ALLOCATE IMAGES //////////////////////////////////////////////////
|
||||
|
||||
ofImage myColorImage1;
|
||||
myColorImage1.clear();
|
||||
myColorImage1.setUseTexture(false);
|
||||
myColorImage1.allocate(RefractiveIndex::_vid_w, RefractiveIndex::_vid_h, OF_IMAGE_COLOR);
|
||||
|
||||
ofImage myGrayImage1;
|
||||
myGrayImage1.setUseTexture(false);
|
||||
myGrayImage1.allocate(RefractiveIndex::_vid_w, RefractiveIndex::_vid_h, OF_IMAGE_GRAYSCALE);
|
||||
|
||||
ofImage myColorImage2;
|
||||
myColorImage2.setUseTexture(false);
|
||||
myColorImage2.allocate(RefractiveIndex::_vid_w, RefractiveIndex::_vid_h, OF_IMAGE_COLOR);
|
||||
//ofxCvImage myColorCvImage2;
|
||||
myColorCvImage2.clear();
|
||||
myColorCvImage2.setUseTexture(false);
|
||||
myColorCvImage2.allocate(RefractiveIndex::_vid_w, RefractiveIndex::_vid_h);
|
||||
|
||||
//ofxCvImage myGrayCvImage1;
|
||||
myGrayCvImage1.clear();
|
||||
myGrayCvImage1.setUseTexture(false);
|
||||
myGrayCvImage1.allocate(RefractiveIndex::_vid_w, RefractiveIndex::_vid_h);
|
||||
|
||||
//////////////////////////////END ALLOCATE IMAGES //////////////////////////////////////////////////
|
||||
|
||||
@ -134,13 +137,11 @@ void AbstractAnalysis::saveImageAnalysis(string filename)
|
||||
//<---- NEW SAVING - seems to fix WINDOWS saving out BLACK FRAMES PROBLEM ---->
|
||||
unsigned char * somePixels;
|
||||
ofPixels appPix = RefractiveIndex::_pixels;
|
||||
//somePixels = new unsigned char [appPix.getWidth()*appPix.getHeight()*3];
|
||||
somePixels = appPix.getPixels();
|
||||
|
||||
//*** This needs to be here for OSX of we get a BAD ACCESS ERROR. DOES IT BREAK WINDOWS? ***//
|
||||
myColorImage1.setUseTexture(false);
|
||||
myColorImage1.setFromPixels(somePixels,appPix.getWidth(),appPix.getHeight(), OF_IMAGE_COLOR);
|
||||
myColorImage1.saveImage(ofToDataPath("")+ _whole_file_path_analysis+"/"+filename);
|
||||
myColorImage1.clear();
|
||||
|
||||
#endif
|
||||
|
||||
@ -159,25 +160,19 @@ void AbstractAnalysis::saveImageSynthesis(string filename, ofxCvImage* newPixels
|
||||
#elif defined(TARGET_WIN32)
|
||||
|
||||
if (newType == OF_IMAGE_COLOR){
|
||||
myColorImage2.setFromPixels(newPixels.getPixels(), newPixels.width, newPixels.width, OF_IMAGE_COLOR);
|
||||
myColorCvImage2.setFromPixels(newPixels.getPixels(), newPixels.width, newPixels.width, OF_IMAGE_COLOR);
|
||||
myColorCvImage2.saveImage(_whole_file_path_synthesis+"/"+thisfilename);
|
||||
myColorCvImage2.clear();
|
||||
}
|
||||
|
||||
if (newType == OF_IMAGE_GRAYSCALE){
|
||||
myGrayImage1.setFromPixels(newPixels.getPixels(), newPixels.width, newPixels.width, OF_IMAGE_GRAYSCALE);
|
||||
myGrayCvImage1.setFromPixels(newPixels.getPixels(), newPixels.width, newPixels.width, OF_IMAGE_GRAYSCALE);
|
||||
myGrayCvImage1.saveImage(_whole_file_path_synthesis+"/"+thisfilename);
|
||||
myGrayCvImage1.clear();
|
||||
}
|
||||
|
||||
myColorImage2.saveImage(_whole_file_path_synthesis+"/"+thisfilename);
|
||||
|
||||
|
||||
//<---- NEW SAVING - seems to fix WINDOWS saving out BLACK FRAMES PROBLEM ---->
|
||||
//unsigned char * somePixels;
|
||||
//ofPixels appPix = RefractiveIndex::_pixels;
|
||||
//somePixels = new unsigned char [appPix.getWidth()*appPix.getHeight()*3];
|
||||
//somePixels = appPix.getPixels();
|
||||
//myImage.allocate(appPix.getWidth(),appPix.getHeight(), OF_IMAGE_COLOR);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
_saved_filenames_synthesis.push_back(_whole_file_path_analysis+"/"+filename);
|
||||
|
||||
}
|
||||
|
||||
@ -65,7 +65,10 @@ protected:
|
||||
|
||||
ofImage myColorImage;
|
||||
ofImage myBlackWhiteImage;
|
||||
|
||||
|
||||
ofxCvColorImage myColorCvImage2;
|
||||
ofxCvColorImage myGrayCvImage1;
|
||||
|
||||
//int _run_cnt;
|
||||
|
||||
float DELTA_T_SAVE;
|
||||
|
||||
@ -45,6 +45,12 @@ void CamNoiseAnalysis::setup(int camWidth, int camHeight)
|
||||
_show_image = false;
|
||||
_image_shown = false;
|
||||
|
||||
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
|
||||
@ -54,9 +60,26 @@ void CamNoiseAnalysis::setup(int camWidth, int camHeight)
|
||||
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);
|
||||
|
||||
//cout << "RefractiveIndex::_vid_w " << RefractiveIndex::_vid_w << endl;
|
||||
//cout << "RefractiveIndex::_vid_h " << RefractiveIndex::_vid_h << endl;
|
||||
|
||||
// clear() apparently fixes the "OF_WARNING: in allocate, reallocating a ofxCvImage"
|
||||
// that we're getting in OSX/Windows and is maybe crashing Windows
|
||||
// http://forum.openframeworks.cc/index.php?topic=1867.0
|
||||
cvColorImage1.clear();
|
||||
cvGrayImage1.clear();
|
||||
cvGrayDiff1.clear();
|
||||
|
||||
cvColorImage2.clear();
|
||||
cvGrayImage2.clear();
|
||||
cvGrayDiff2.clear();
|
||||
|
||||
cvColorImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayDiff1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
|
||||
@ -39,12 +39,15 @@ void ColorMultiAnalysis::setup(int camWidth, int camHeight)
|
||||
int anim_time = 10; // 10 seconds
|
||||
_anim_cnt_max = anim_time*ofGetFrameRate(); // e.g.: 30 frames per second = 150 frames
|
||||
|
||||
//for an ofxOpenCv.h image i would like to use..."
|
||||
//image3.allocate(RefractiveIndex::_vid_w, RefractiveIndex::_vid_h);
|
||||
|
||||
_show_image = false;
|
||||
_image_shown = false;
|
||||
|
||||
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
|
||||
@ -54,9 +57,26 @@ void ColorMultiAnalysis::setup(int camWidth, int camHeight)
|
||||
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);
|
||||
|
||||
//cout << "RefractiveIndex::_vid_w " << RefractiveIndex::_vid_w << endl;
|
||||
//cout << "RefractiveIndex::_vid_h " << RefractiveIndex::_vid_h << endl;
|
||||
|
||||
// clear() apparently fixes the "OF_WARNING: in allocate, reallocating a ofxCvImage"
|
||||
// that we're getting in OSX/Windows and is maybe crashing Windows
|
||||
// http://forum.openframeworks.cc/index.php?topic=1867.0
|
||||
cvColorImage1.clear();
|
||||
cvGrayImage1.clear();
|
||||
cvGrayDiff1.clear();
|
||||
|
||||
cvColorImage2.clear();
|
||||
cvGrayImage2.clear();
|
||||
cvGrayDiff2.clear();
|
||||
|
||||
cvColorImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayDiff1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
|
||||
@ -49,6 +49,12 @@ void ColorSingleAnalysis::setup(int camWidth, int camHeight)
|
||||
_show_image = false;
|
||||
_image_shown = false;
|
||||
|
||||
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
|
||||
@ -58,9 +64,26 @@ void ColorSingleAnalysis::setup(int camWidth, int camHeight)
|
||||
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);
|
||||
|
||||
//cout << "RefractiveIndex::_vid_w " << RefractiveIndex::_vid_w << endl;
|
||||
//cout << "RefractiveIndex::_vid_h " << RefractiveIndex::_vid_h << endl;
|
||||
|
||||
// clear() apparently fixes the "OF_WARNING: in allocate, reallocating a ofxCvImage"
|
||||
// that we're getting in OSX/Windows and is maybe crashing Windows
|
||||
// http://forum.openframeworks.cc/index.php?topic=1867.0
|
||||
cvColorImage1.clear();
|
||||
cvGrayImage1.clear();
|
||||
cvGrayDiff1.clear();
|
||||
|
||||
cvColorImage2.clear();
|
||||
cvGrayImage2.clear();
|
||||
cvGrayDiff2.clear();
|
||||
|
||||
cvColorImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayDiff1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
|
||||
@ -43,8 +43,11 @@ void DiffNoiseAnalysis::setup(int camWidth, int camHeight)
|
||||
_show_image = false;
|
||||
_image_shown = false;
|
||||
|
||||
//for an ofxOpenCv.h image i would like to use..."
|
||||
//image3.allocate(RefractiveIndex::_vid_w, RefractiveIndex::_vid_h);
|
||||
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
|
||||
@ -55,9 +58,26 @@ void DiffNoiseAnalysis::setup(int camWidth, int camHeight)
|
||||
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);
|
||||
|
||||
//cout << "RefractiveIndex::_vid_w " << RefractiveIndex::_vid_w << endl;
|
||||
//cout << "RefractiveIndex::_vid_h " << RefractiveIndex::_vid_h << endl;
|
||||
|
||||
// clear() apparently fixes the "OF_WARNING: in allocate, reallocating a ofxCvImage"
|
||||
// that we're getting in OSX/Windows and is maybe crashing Windows
|
||||
// http://forum.openframeworks.cc/index.php?topic=1867.0
|
||||
cvColorImage1.clear();
|
||||
cvGrayImage1.clear();
|
||||
cvGrayDiff1.clear();
|
||||
|
||||
cvColorImage2.clear();
|
||||
cvGrayImage2.clear();
|
||||
cvGrayDiff2.clear();
|
||||
|
||||
cvColorImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayDiff1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
|
||||
@ -43,6 +43,12 @@ void IResponseAnalysis::setup(int camWidth, int camHeight)
|
||||
_show_image = false;
|
||||
_image_shown = false;
|
||||
|
||||
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
|
||||
@ -52,9 +58,26 @@ void IResponseAnalysis::setup(int camWidth, int camHeight)
|
||||
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);
|
||||
|
||||
//cout << "RefractiveIndex::_vid_w " << RefractiveIndex::_vid_w << endl;
|
||||
//cout << "RefractiveIndex::_vid_h " << RefractiveIndex::_vid_h << endl;
|
||||
|
||||
// clear() apparently fixes the "OF_WARNING: in allocate, reallocating a ofxCvImage"
|
||||
// that we're getting in OSX/Windows and is maybe crashing Windows
|
||||
// http://forum.openframeworks.cc/index.php?topic=1867.0
|
||||
cvColorImage1.clear();
|
||||
cvGrayImage1.clear();
|
||||
cvGrayDiff1.clear();
|
||||
|
||||
cvColorImage2.clear();
|
||||
cvGrayImage2.clear();
|
||||
cvGrayDiff2.clear();
|
||||
|
||||
cvColorImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayDiff1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
|
||||
@ -45,6 +45,12 @@ void RelaxRateAnalysis::setup(int camWidth, int camHeight)
|
||||
_show_image = false;
|
||||
_image_shown = false;
|
||||
|
||||
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
|
||||
@ -54,9 +60,27 @@ void RelaxRateAnalysis::setup(int camWidth, int camHeight)
|
||||
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);
|
||||
|
||||
//cout << "RefractiveIndex::_vid_w " << RefractiveIndex::_vid_w << endl;
|
||||
//cout << "RefractiveIndex::_vid_h " << RefractiveIndex::_vid_h << endl;
|
||||
|
||||
// clear() apparently fixes the "OF_WARNING: in allocate, reallocating a ofxCvImage"
|
||||
// that we're getting in OSX/Windows and is maybe crashing Windows
|
||||
// http://forum.openframeworks.cc/index.php?topic=1867.0
|
||||
cvColorImage1.clear();
|
||||
cvGrayImage1.clear();
|
||||
cvGrayDiff1.clear();
|
||||
|
||||
cvColorImage2.clear();
|
||||
cvGrayImage2.clear();
|
||||
cvGrayDiff2.clear();
|
||||
|
||||
|
||||
cvColorImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayDiff1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
@ -288,7 +312,7 @@ void RelaxRateAnalysis::draw()
|
||||
}
|
||||
}
|
||||
|
||||
cout << "_anim_cnt = " << _anim_cnt << endl;
|
||||
//cout << "_anim_cnt = " << _anim_cnt << endl;
|
||||
|
||||
if (_anim_cnt > (_anim_cnt_max-_fade_in_frames) && _anim_cnt <= _anim_cnt_max) {
|
||||
|
||||
|
||||
@ -51,6 +51,12 @@ void ShadowScapesAnalysis::setup(int camWidth, int camHeight)
|
||||
_show_image = false;
|
||||
_image_shown = false;
|
||||
|
||||
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
|
||||
@ -60,9 +66,26 @@ void ShadowScapesAnalysis::setup(int camWidth, int camHeight)
|
||||
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);
|
||||
|
||||
//cout << "RefractiveIndex::_vid_w " << RefractiveIndex::_vid_w << endl;
|
||||
//cout << "RefractiveIndex::_vid_h " << RefractiveIndex::_vid_h << endl;
|
||||
|
||||
// clear() apparently fixes the "OF_WARNING: in allocate, reallocating a ofxCvImage"
|
||||
// that we're getting in OSX/Windows and is maybe crashing Windows
|
||||
// http://forum.openframeworks.cc/index.php?topic=1867.0
|
||||
cvColorImage1.clear();
|
||||
cvGrayImage1.clear();
|
||||
cvGrayDiff1.clear();
|
||||
|
||||
cvColorImage2.clear();
|
||||
cvGrayImage2.clear();
|
||||
cvGrayDiff2.clear();
|
||||
|
||||
cvColorImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayDiff1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
|
||||
@ -40,10 +40,15 @@ void ShapeFromShadingAnalysis::setup(int camWidth, int camHeight)
|
||||
int anim_time = 5; // 10 seconds
|
||||
_anim_cnt_max = anim_time*ofGetFrameRate(); // e.g.: 30 frames per second = 150 frames
|
||||
|
||||
|
||||
_show_image = false;
|
||||
_image_shown = false;
|
||||
|
||||
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
|
||||
@ -53,9 +58,26 @@ void ShapeFromShadingAnalysis::setup(int camWidth, int camHeight)
|
||||
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);
|
||||
|
||||
// cout << "RefractiveIndex::_vid_w " << RefractiveIndex::_vid_w << endl;
|
||||
// cout << "RefractiveIndex::_vid_h " << RefractiveIndex::_vid_h << endl;
|
||||
|
||||
// clear() apparently fixes the "OF_WARNING: in allocate, reallocating a ofxCvImage"
|
||||
// that we're getting in OSX/Windows and is maybe crashing Windows
|
||||
// http://forum.openframeworks.cc/index.php?topic=1867.0
|
||||
cvColorImage1.clear();
|
||||
cvGrayImage1.clear();
|
||||
cvGrayDiff1.clear();
|
||||
|
||||
cvColorImage2.clear();
|
||||
cvGrayImage2.clear();
|
||||
cvGrayDiff2.clear();
|
||||
|
||||
cvColorImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayDiff1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
|
||||
@ -44,6 +44,12 @@ void StrobeAnalysis::setup(int camWidth, int camHeight)
|
||||
_show_image = false;
|
||||
_image_shown = false;
|
||||
|
||||
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
|
||||
@ -53,9 +59,26 @@ void StrobeAnalysis::setup(int camWidth, int camHeight)
|
||||
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);
|
||||
|
||||
// cout << "RefractiveIndex::_vid_w " << RefractiveIndex::_vid_w << endl;
|
||||
// cout << "RefractiveIndex::_vid_h " << RefractiveIndex::_vid_h << endl;
|
||||
|
||||
// clear() apparently fixes the "OF_WARNING: in allocate, reallocating a ofxCvImage"
|
||||
// that we're getting in OSX/Windows and is maybe crashing Windows
|
||||
// http://forum.openframeworks.cc/index.php?topic=1867.0
|
||||
cvColorImage1.clear();
|
||||
cvGrayImage1.clear();
|
||||
cvGrayDiff1.clear();
|
||||
|
||||
cvColorImage2.clear();
|
||||
cvGrayImage2.clear();
|
||||
cvGrayDiff2.clear();
|
||||
|
||||
cvColorImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayImage1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
cvGrayDiff1.allocate(RefractiveIndex::_vid_w,RefractiveIndex::_vid_h);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user