2 Commits

Author SHA1 Message Date
Jamie Allen 97e24c31f2 added file name sorting code to abrastract analysis 2012-04-09 13:42:40 +02:00
Jamie Allen f66ce7e2e8 basically the same as dviid02_dviid_1 - just got it working...
there does seem to be some kind of strange file saving ordering problem
going on... into the 'drawing' --> folder. will look at it and try and
see what its doing wrong
2012-04-08 20:56:28 +02:00
3 changed files with 104 additions and 64 deletions
+39 -2
View File
@@ -157,19 +157,56 @@ void AbstractAnalysis::create_dir_allocate_images()
} }
void AbstractAnalysis::read_dir_create_list(string folder_path)
bool cmp_file(string f0, string f1)
{ {
int v0 = atoi(f0.substr(0, f0.find("_")).c_str());
int v1 = atoi(f1.substr(0, f1.find("_")).c_str());
return v0 < v1;
}
void AbstractAnalysis::read_dir_create_list(string folder_path)
{
File dir(folder_path); File dir(folder_path);
if(dir.exists() && dir.isDirectory()) { if(dir.exists() && dir.isDirectory()) {
vector<string> list; vector<string> list;
dir.list(list); dir.list(list);
std::sort(list.begin(), list.end(), cmp_file);
for(int i = 0; i < list.size(); i++) { for(int i = 0; i < list.size(); i++) {
string filepath = folder_path + "/" + list[i]; string filepath = folder_path + "/" + list[i];
_saved_filenames_analysis.push_back(filepath); _saved_filenames_analysis.push_back(filepath);
}
} }
} }
}
void AbstractAnalysis::saveImageAnalysis(string filename) void AbstractAnalysis::saveImageAnalysis(string filename)
{ {
+3
View File
@@ -65,5 +65,8 @@ 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;
unsigned char * imagePixels;
int vectorCount;
ofVec2f * vectorField;
}; };