Inserted pipeline_data into additional places

This commit is contained in:
Matt Hill
2014-07-01 17:44:39 -04:00
parent 552caf5a05
commit b9422dc063
7 changed files with 38 additions and 46 deletions

View File

@@ -211,16 +211,19 @@ int main( int argc, const char** argv )
for (int z = 0; z < regions.size(); z++)
{
PipelineData pipeline_data(frame, regions[z].rect, &config);
getTime(&startTime);
char temp[5];
stateIdentifier.recognize(frame, regions[z].rect, temp);
stateIdentifier.recognize(&pipeline_data);
getTime(&endTime);
double stateidTime = diffclock(startTime, endTime);
cout << "\tRegion " << z << ": State ID time: " << stateidTime << "ms." << endl;
stateIdTimes.push_back(stateidTime);
getTime(&startTime);
LicensePlateCandidate lp(frame, regions[z].rect, &config);
LicensePlateCandidate lp(&pipeline_data);
lp.recognize();
getTime(&endTime);
double analysisTime = diffclock(startTime, endTime);

View File

@@ -79,31 +79,26 @@ int main( int argc, const char** argv )
cout << fullpath << endl;
frame = imread( fullpath.c_str() );
char code[4];
int confidence = identifier.recognize(frame, code);
PipelineData pipeline_data(frame, Rect(0, 0, frame.cols, frame.rows), &config);
identifier.recognize(&pipeline_data);
if (confidence <= 20)
if (pipeline_data.region_confidence <= 20)
{
code[0] = 'z';
code[1] = 'z';
confidence = 100;
pipeline_data.region_code = 'zz';
pipeline_data.region_confidence = 100;
}
//imshow("Plate", frame);
if (confidence > 20)
{
cout << confidence << " : " << code;
else
{
cout << pipeline_data.region_confidence << " : " << pipeline_data.region_code;
ostringstream convert; // stream used for the conversion
convert << i; // insert the textual representation of 'Number' in the characters in the stream
string copyCommand = "cp \"" + fullpath + "\" " + outDir + code + convert.str() + ".png";
string copyCommand = "cp \"" + fullpath + "\" " + outDir + pipeline_data.region_code + convert.str() + ".png";
system( copyCommand.c_str() );
waitKey(50);
//while ((char) waitKey(50) != 'c') { }
}
else
waitKey(50);
}
}
}