Merge pull request #146 from psaintjust/fix_char_analysis_timings

Fixed incorrect character analysis time
This commit is contained in:
Matthew Hill
2015-06-29 21:41:56 -04:00

View File

@@ -50,13 +50,14 @@ namespace alpr
void CharacterAnalysis::analyze() void CharacterAnalysis::analyze()
{ {
timespec startTime;
getTimeMonotonic(&startTime);
pipeline_data->clearThresholds(); pipeline_data->clearThresholds();
pipeline_data->thresholds = produceThresholds(pipeline_data->crop_gray, config); pipeline_data->thresholds = produceThresholds(pipeline_data->crop_gray, config);
timespec contoursStartTime;
getTimeMonotonic(&contoursStartTime);
timespec startTime;
getTimeMonotonic(&startTime);
pipeline_data->textLines.clear(); pipeline_data->textLines.clear();
@@ -69,13 +70,14 @@ namespace alpr
if (config->debugTiming) if (config->debugTiming)
{ {
timespec endTime; timespec contoursEndTime;
getTimeMonotonic(&endTime); getTimeMonotonic(&contoursEndTime);
cout << " -- Character Analysis Find Contours Time: " << diffclock(startTime, endTime) << "ms." << endl; cout << " -- Character Analysis Find Contours Time: " << diffclock(contoursStartTime, contoursEndTime) << "ms." << endl;
} }
//Mat img_equalized = equalizeBrightness(img_gray); //Mat img_equalized = equalizeBrightness(img_gray);
getTimeMonotonic(&startTime); timespec filterStartTime;
getTimeMonotonic(&filterStartTime);
for (unsigned int i = 0; i < pipeline_data->thresholds.size(); i++) for (unsigned int i = 0; i < pipeline_data->thresholds.size(); i++)
{ {
@@ -87,9 +89,9 @@ namespace alpr
if (config->debugTiming) if (config->debugTiming)
{ {
timespec endTime; timespec filterEndTime;
getTimeMonotonic(&endTime); getTimeMonotonic(&filterEndTime);
cout << " -- Character Analysis Filter Time: " << diffclock(startTime, endTime) << "ms." << endl; cout << " -- Character Analysis Filter Time: " << diffclock(filterStartTime, filterEndTime) << "ms." << endl;
} }
PlateMask plateMask(pipeline_data); PlateMask plateMask(pipeline_data);
@@ -206,7 +208,6 @@ namespace alpr
this->confidence = 100 - confidenceDrainers; this->confidence = 100 - confidenceDrainers;
} }
if (config->debugTiming) if (config->debugTiming)
{ {
timespec endTime; timespec endTime;
@@ -660,4 +661,4 @@ namespace alpr
return charArea; return charArea;
} }
} }