a few tweaks to the main draw loop
working on the colormulti and colorsingle outputs still
This commit is contained in:
parent
e0e170b522
commit
1e5bb28b43
@ -222,13 +222,29 @@ void RefractiveIndex::draw()
|
|||||||
ofBackground(0, 0, 0);
|
ofBackground(0, 0, 0);
|
||||||
|
|
||||||
if(_currentAnalysis){
|
if(_currentAnalysis){
|
||||||
_currentAnalysis->draw();
|
|
||||||
|
|
||||||
|
_currentAnalysis->draw();
|
||||||
|
|
||||||
if(_currentAnalysis->meshIsComplete){
|
if(_currentAnalysis->meshIsComplete){
|
||||||
|
|
||||||
fbo.begin();
|
fbo.begin();
|
||||||
glShadeModel(GL_SMOOTH);
|
glShadeModel(GL_SMOOTH);
|
||||||
|
glEnable(GL_NORMALIZE);
|
||||||
|
//glEnable(GL_DEPTH_TEST);
|
||||||
|
//light.enable();
|
||||||
|
//ofEnableSeparateSpecularLight();
|
||||||
|
|
||||||
|
ofEnableSmoothing();
|
||||||
|
|
||||||
|
//ofSetLineWidth(1.0f);
|
||||||
|
//glPointSize(5.0f);
|
||||||
|
|
||||||
|
//glHint(GL_NICEST);
|
||||||
|
ofEnableBlendMode ( OF_BLENDMODE_ADD );
|
||||||
|
//ofEnableBlendMode ( OF_BLENDMODE_MULTIPLY );
|
||||||
|
//ofEnableBlendMode ( OF_BLENDMODE_SUBTRACT );
|
||||||
|
//ofEnableBlendMode ( OF_BLENDMODE_ALPHA );
|
||||||
|
//ofEnableBlendMode ( OF_BLENDMODE_SCREEN );
|
||||||
|
|
||||||
ofClear(0,0,0);
|
ofClear(0,0,0);
|
||||||
|
|
||||||
@ -243,15 +259,13 @@ void RefractiveIndex::draw()
|
|||||||
ofPopMatrix();
|
ofPopMatrix();
|
||||||
ofSetColor(255);
|
ofSetColor(255);
|
||||||
|
|
||||||
float xDiff= (fbo.getWidth()- (_currentAnalysis->_mesh_size_multiplier * _vid_w))/2;
|
float xDiff= (fbo.getWidth()- 1.33333*(_currentAnalysis->_mesh_size_multiplier * _vid_w))/2;
|
||||||
float yDiff= (fbo.getHeight()- (_currentAnalysis->_mesh_size_multiplier * _vid_h))/2;
|
float yDiff= (fbo.getHeight()- 1.0*(_currentAnalysis->_mesh_size_multiplier * _vid_h))/2;
|
||||||
|
|
||||||
ofTranslate(xDiff,yDiff,-_currentAnalysis->zPlaneAverage );
|
ofTranslate(xDiff,yDiff,-_currentAnalysis->zPlaneAverage );
|
||||||
|
ofScale(1.33333,1.0,1.0);
|
||||||
ofEnableBlendMode ( OF_BLENDMODE_ADD ) ;
|
_currentAnalysis->aMesh.drawVertices();
|
||||||
_currentAnalysis->aMesh.draw();
|
_currentAnalysis->aMesh.draw();
|
||||||
ofDisableBlendMode( ) ;
|
|
||||||
|
|
||||||
|
|
||||||
camera.end();
|
camera.end();
|
||||||
fbo.end();
|
fbo.end();
|
||||||
@ -263,6 +277,7 @@ void RefractiveIndex::draw()
|
|||||||
//saving jpgs doesn't work - pngs only!
|
//saving jpgs doesn't work - pngs only!
|
||||||
// PNG is fine - better for Final Cut anyway!
|
// PNG is fine - better for Final Cut anyway!
|
||||||
|
|
||||||
|
ofDisableBlendMode( ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,6 +64,7 @@ public:
|
|||||||
bool meshIsComplete;
|
bool meshIsComplete;
|
||||||
bool imageForContourAvailable;
|
bool imageForContourAvailable;
|
||||||
ofMesh aMesh;
|
ofMesh aMesh;
|
||||||
|
ofLight light;
|
||||||
|
|
||||||
string meshFileName;
|
string meshFileName;
|
||||||
//difference between our image size and the size of the fbo
|
//difference between our image size and the size of the fbo
|
||||||
|
|||||||
@ -64,4 +64,7 @@ protected:
|
|||||||
//this is the temporary container to allow us to convert and save out greyscale images
|
//this is the temporary container to allow us to convert and save out greyscale images
|
||||||
ofxCvColorImage cvConvertorImage;
|
ofxCvColorImage cvConvertorImage;
|
||||||
|
|
||||||
|
bool _gotFirstImage;
|
||||||
|
ofImage _background;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -21,6 +21,14 @@ void DiffNoiseAnalysis::setup(int camWidth, int camHeight)
|
|||||||
cout << "NUM_RUN DiffNoiseAnalysis " << NUM_RUN << endl;
|
cout << "NUM_RUN DiffNoiseAnalysis " << NUM_RUN << endl;
|
||||||
//NUM_RUN = 5;
|
//NUM_RUN = 5;
|
||||||
|
|
||||||
|
//flag for main sketch
|
||||||
|
meshIsComplete=false;
|
||||||
|
_gotFirstImage=false;
|
||||||
|
|
||||||
|
_mesh_size_multiplier=4;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int acq_run_time; // 10 seconds of acquiring per run
|
int acq_run_time; // 10 seconds of acquiring per run
|
||||||
acq_run_time = RefractiveIndex::XML.getValue("config:analysis_time:acquiretime_diffnoise", ACQUIRE_TIME);
|
acq_run_time = RefractiveIndex::XML.getValue("config:analysis_time:acquiretime_diffnoise", ACQUIRE_TIME);
|
||||||
cout << "ACQUIRE_TIME DiffNoiseAnalysis " << acq_run_time << endl;
|
cout << "ACQUIRE_TIME DiffNoiseAnalysis " << acq_run_time << endl;
|
||||||
|
|||||||
@ -63,4 +63,7 @@ protected:
|
|||||||
//this is the temporary container to allow us to convert and save out greyscale images
|
//this is the temporary container to allow us to convert and save out greyscale images
|
||||||
ofxCvColorImage cvConvertorImage;
|
ofxCvColorImage cvConvertorImage;
|
||||||
|
|
||||||
|
bool _gotFirstImage;
|
||||||
|
ofImage _background;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -21,6 +21,12 @@ void IResponseAnalysis::setup(int camWidth, int camHeight)
|
|||||||
cout << "NUM_RUN IResponseAnalysis " << NUM_RUN << endl;
|
cout << "NUM_RUN IResponseAnalysis " << NUM_RUN << endl;
|
||||||
//NUM_RUN = 5;
|
//NUM_RUN = 5;
|
||||||
|
|
||||||
|
//flag for main sketch
|
||||||
|
meshIsComplete=false;
|
||||||
|
_gotFirstImage=false;
|
||||||
|
|
||||||
|
_mesh_size_multiplier=4;
|
||||||
|
|
||||||
int acq_run_time; // 10 seconds of acquiring per run
|
int acq_run_time; // 10 seconds of acquiring per run
|
||||||
acq_run_time = RefractiveIndex::XML.getValue("config:analysis_time:acquiretime_iresponse", ACQUIRE_TIME);
|
acq_run_time = RefractiveIndex::XML.getValue("config:analysis_time:acquiretime_iresponse", ACQUIRE_TIME);
|
||||||
cout << "ACQUIRE_TIME IResponseAnalysis " << acq_run_time << endl;
|
cout << "ACQUIRE_TIME IResponseAnalysis " << acq_run_time << endl;
|
||||||
@ -463,7 +469,7 @@ void IResponseAnalysis::setMeshFromPixels(vector<float> sPixels, ofImage current
|
|||||||
x=0;
|
x=0;
|
||||||
y++;
|
y++;
|
||||||
//something is going badly wrong with my maths for me to need this HELP TODO fix this - why am I running over the end of the vector?
|
//something is going badly wrong with my maths for me to need this HELP TODO fix this - why am I running over the end of the vector?
|
||||||
if(y>=479){
|
if(y>=currentSecondImage.getHeight()-1){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,4 +51,7 @@ protected:
|
|||||||
vector<rfiCvContourFinder*> cvContourFinderVect;
|
vector<rfiCvContourFinder*> cvContourFinderVect;
|
||||||
vector<rfiCvContourFinder*> cvContourFinderVectDisplay;
|
vector<rfiCvContourFinder*> cvContourFinderVectDisplay;
|
||||||
|
|
||||||
|
bool _gotFirstImage;
|
||||||
|
ofImage _background;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -25,6 +25,14 @@ void ShadowScapesAnalysis::setup(int camWidth, int camHeight)
|
|||||||
cout << "NUM_RUN ShadowScapesAnalysis " << NUM_RUN << endl;
|
cout << "NUM_RUN ShadowScapesAnalysis " << NUM_RUN << endl;
|
||||||
//NUM_RUN = 5;
|
//NUM_RUN = 5;
|
||||||
|
|
||||||
|
//flag for main sketch
|
||||||
|
meshIsComplete=false;
|
||||||
|
_gotFirstImage=false;
|
||||||
|
|
||||||
|
_mesh_size_multiplier=4;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int acq_run_time; // 10 seconds of acquiring per run
|
int acq_run_time; // 10 seconds of acquiring per run
|
||||||
acq_run_time = RefractiveIndex::XML.getValue("config:analysis_time:acquiretime_shadowscapes", ACQUIRE_TIME);
|
acq_run_time = RefractiveIndex::XML.getValue("config:analysis_time:acquiretime_shadowscapes", ACQUIRE_TIME);
|
||||||
cout << "ACQUIRE_TIME ShadowScapesAnalysis " << acq_run_time << endl;
|
cout << "ACQUIRE_TIME ShadowScapesAnalysis " << acq_run_time << endl;
|
||||||
|
|||||||
@ -69,4 +69,7 @@ protected:
|
|||||||
//this is the temporary container to allow us to convert and save out greyscale images
|
//this is the temporary container to allow us to convert and save out greyscale images
|
||||||
ofxCvColorImage cvConvertorImage;
|
ofxCvColorImage cvConvertorImage;
|
||||||
|
|
||||||
|
bool _gotFirstImage;
|
||||||
|
ofImage _background;
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -82,4 +82,6 @@ protected:
|
|||||||
//this is the temporary container to allow us to convert and save out greyscale images
|
//this is the temporary container to allow us to convert and save out greyscale images
|
||||||
ofxCvColorImage cvConvertorImage;
|
ofxCvColorImage cvConvertorImage;
|
||||||
|
|
||||||
|
bool _gotFirstImage;
|
||||||
|
ofImage _background;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -68,4 +68,7 @@ protected:
|
|||||||
//this is the temporary container to allow us to convert and save out greyscale images
|
//this is the temporary container to allow us to convert and save out greyscale images
|
||||||
ofxCvColorImage cvConvertorImage;
|
ofxCvColorImage cvConvertorImage;
|
||||||
|
|
||||||
|
bool _gotFirstImage;
|
||||||
|
ofImage _background;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user