mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-08 15:00:07 +08:00
Inserted pipeline_data into additional places
This commit is contained in:
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user