now displays images after saving them out and also fixed maths booboo with analysis
This commit is contained in:
parent
706eb9354d
commit
a9c8a56850
@ -19,7 +19,7 @@
|
||||
#define CAMERA_ACQU_WIDTH 640
|
||||
#define CAMERA_ACQU_HEIGHT 480
|
||||
|
||||
#define LOCATION "BRADFORD"
|
||||
#define LOCATION "MANCHESTER"
|
||||
|
||||
#define ISTATE_UNDEF 0xEEEE
|
||||
#define ISTATE_START 0xAAAA
|
||||
@ -216,7 +216,7 @@ void RefractiveIndex::draw()
|
||||
|
||||
if(_currentAnalysis){
|
||||
_currentAnalysis->draw();
|
||||
cout<<_currentAnalysis->meshIsComplete<<endl;
|
||||
|
||||
if(_currentAnalysis->meshIsComplete){
|
||||
fbo.begin();
|
||||
|
||||
@ -231,7 +231,7 @@ void RefractiveIndex::draw()
|
||||
fbo.end();
|
||||
ofPixels pixels;
|
||||
fbo.readToPixels(pixels);
|
||||
cout<<_currentAnalysis->meshFileName<<endl;
|
||||
|
||||
|
||||
ofSaveImage(pixels,_currentAnalysis->meshFileName, OF_IMAGE_QUALITY_BEST);
|
||||
//saving jpgs doesn't work maybe because of of_image_quality
|
||||
|
||||
@ -195,6 +195,8 @@ void IResponseAnalysis::synthesise()
|
||||
setMeshFromPixels(make3DZmap(image1, image5, _background), image1,image5, aMesh);
|
||||
//with jpgs this was refusing to save out
|
||||
meshFileName = _whole_file_path_synthesis+"/"+ofToString(_synth_save_cnt, 2)+"_IResponseSynthesis_"+ofToString(_run_cnt,2)+".png";
|
||||
_saved_filenames_synthesis.push_back(meshFileName);
|
||||
|
||||
//flag that we are finished
|
||||
meshIsComplete=true;
|
||||
_synth_save_cnt++;
|
||||
@ -484,9 +486,10 @@ ofPixels IResponseAnalysis::make3DZmap(ofImage &image1, ofImage &image2, ofImage
|
||||
ofColor colourImage2 = imagePixels2.getColor(x, y);
|
||||
|
||||
float _distanceToCentre=ofDist(imagePixels1.getWidth()/2, imagePixels1.getHeight()/2, x, y);
|
||||
float _presumedBrightness=ofMap( sqrt(_distanceToCentre), 0, sqrt(_maxPossibleDistanceToCentre), 0, 255);
|
||||
|
||||
float _presumedBrightness=ofMap( sqrt(_maxPossibleDistanceToCentre)-sqrt(_distanceToCentre), 0, sqrt(_maxPossibleDistanceToCentre), 0, 255);
|
||||
//float _presumedBrightness=255;
|
||||
int thisDiff=abs(colourImage1.getBrightness()-_presumedBrightness);
|
||||
//cout<<thisDiff<< " thisDiff "<<endl;
|
||||
|
||||
thesePixels[i]=thisDiff;
|
||||
thesePixels[i+1]=thisDiff;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user