diff --git a/src/AbstractAnalysis.cpp b/src/AbstractAnalysis.cpp index 9623d1b..e5432e1 100644 --- a/src/AbstractAnalysis.cpp +++ b/src/AbstractAnalysis.cpp @@ -41,6 +41,7 @@ void AbstractAnalysis::do_synthesize() { _state = STATE_SYNTHESISING; synthesise(); _state = STATE_DISPLAY_RESULTS; + display_results(); ofNotifyEvent(_synthesize_cb, _name); } @@ -143,7 +144,70 @@ ofPixels AbstractAnalysis::calculateListOfZValues(ofImage image1, ofImage image2 } -void AbstractAnalysis:: setMeshFromPixels(ofPixels somePixels, ofImage currentSecondImage, ofMesh * someMesh){ +ofPixels AbstractAnalysis::calculateListOfZValues(ofImage image1, ofImage image2, int whichComparison, int colourValue){ + //zScale is the mapping factor from pixel difference to shift on the zPlane + int zScale=200; + + ofPixels imagePixels1 = image1.getPixelsRef(); + ofPixels imagePixels2 = image2.getPixelsRef(); + + ofPixels difference; + //this unsigned char should be unnecessary - I would have thought - can't you just address the pixel locations in ofPixels directly? + unsigned char * thesePixels = new unsigned char[ imagePixels1.getWidth()*imagePixels1.getHeight()*3]; + + //where are we in the image pixel array + int x=0; + int y=0; + + //for each pixel... + for(int i=0;iimagePixels1.getWidth()){ + x=0; + y++; + + } + } + + difference.setFromPixels(thesePixels,imagePixels1.getWidth(),imagePixels1.getHeight(), 3); + + return difference; + +} + +void AbstractAnalysis::setMeshFromPixels(ofPixels somePixels, ofImage currentSecondImage, ofMesh * someMesh){ int x=0; int y=0; @@ -165,3 +229,55 @@ void AbstractAnalysis:: setMeshFromPixels(ofPixels somePixels, ofImage currentSe } } + +vectorAbstractAnalysis:: getListOfImageFilePaths(string location, string whichAnalysis){ + + string path = ofToDataPath("")+"debug_analysis/"+location+"/"+whichAnalysis; + ofxDirList dirList; + + int numDirs = dirList.listDir(path); + + vectordirectoryNames; + + //get the last folder alphabetically - this should probably change to do something fancy with date to find most recent but don't want to code that until we are sure + string dirName=dirList.getName(numDirs-1); + + + const char *results=dirName.c_str(); + + ofFile file=ofFile(path+"/"+dirName); + vectorfileNamesToReturn; + + + // get + if(file.isDirectory()){ + dirList.listDir(path+"/"+dirName); + //if there are no files, exit here + if(dirList.size()==0){ + //if it's empty return an error warning + fileNamesToReturn.push_back("NO FILE HERE!"); + cout<<"NO FILE HERE!"; + return fileNamesToReturn; + } + for (int i=0; i getListOfImageFilePaths(string location, string whichAnalysis); public: string _name; diff --git a/src/ColorSingleAnalysis.cpp b/src/ColorSingleAnalysis.cpp index 6779da9..8ed26df 100755 --- a/src/ColorSingleAnalysis.cpp +++ b/src/ColorSingleAnalysis.cpp @@ -77,7 +77,7 @@ void ColorSingleAnalysis::synthesise() int index=0; //if you want to see what this looks like with real data ignore the new filenames and load teh old ones. - bool debug=false; + bool debug=true; if(debug){ _saved_filenames.clear(); _saved_filenames=getListOfImageFilePaths("MIDDLESBOROUGH", _name);