Skip to content
Snippets Groups Projects
Commit 7edb818c authored by Thomas Boy's avatar Thomas Boy
Browse files

bugfix some basic-string::substr: pos error

parent 33167d26
No related branches found
No related tags found
No related merge requests found
......@@ -316,6 +316,13 @@ int main(int argc, char * argv[])
clock_t begin = clock();
fileName = inputDir + TToolBox::getFileName(frameCounter);
//check the string
cout <<"open fileName: "<< fileName<<endl;
if(fileName.empty())
cerr <<"error: empty string fileName"<<endl;
cout <<"\t"<<frameCounter<<"\tof \t"<<amountFiles<<" load file :"<< fileName<<endl;
//cv::imwrite(convert.str().c_str(), img_output);
//we open the file
......@@ -504,6 +511,12 @@ int main(int argc, char * argv[])
//! step 8: we write down all our results in yml file
std::string nameOutPutFileData = outputDir + TToolBox::mNzero(frameCounter) + ".yml";
//check the string
cout <<"write output nameOutPutFileData: "<< nameOutPutFileData<<endl;
if(nameOutPutFileData.empty())
cerr <<"error: empty string nameOutPutFileData"<<endl;
FileStorage fs(nameOutPutFileData.c_str(), FileStorage::WRITE);
fs << "masscenters" << massCenters;
fs << "polygonselection"<< contourSelection;
......@@ -546,6 +559,12 @@ int main(int argc, char * argv[])
addWeighted( imgDebugPaint2, 0.7, imgOverlay2, 0.3, 0.0, imgOverlay2);
//we write the file down
std::string nameOutPutFileDBGpic = outputDir + TToolBox::mNzero(frameCounter) + ".jpg";
//check the string
cout <<"write dbg file: "<< nameOutPutFileDBGpic<<endl;
if(nameOutPutFileDBGpic.empty())
cerr <<"error: empty string nameOutPutFileDBGpic"<<endl;
imwrite(nameOutPutFileDBGpic.c_str(),imgOverlay2);
}
......@@ -553,7 +572,7 @@ int main(int argc, char * argv[])
}//end if the loaded picture has data
else
{
cout<<"error loading file: "<< fileName<<", will skip this file"<<endl;
cerr<<"error loading file: "<< fileName<<", will skip this file"<<endl;
myFileErrorList.push_back(fileName);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment