Moved prewarp initialization higher, initializing detector with prewarp

This commit is contained in:
Matt Hill
2016-03-14 22:26:49 -04:00
parent 9b27f5084e
commit 7db326522c

View File

@@ -45,6 +45,8 @@ namespace alpr
return; return;
} }
prewarp = new PreWarp(config);
loadRecognizers(); loadRecognizers();
setNumThreads(0); setNumThreads(0);
@@ -53,8 +55,6 @@ namespace alpr
this->topN = DEFAULT_TOPN; this->topN = DEFAULT_TOPN;
setDefaultRegion(""); setDefaultRegion("");
prewarp = new PreWarp(config);
timespec endTime; timespec endTime;
getTimeMonotonic(&endTime); getTimeMonotonic(&endTime);
if (config->debugTiming) if (config->debugTiming)
@@ -716,7 +716,7 @@ namespace alpr
{ {
// Country training data has not already been loaded. Load it. // Country training data has not already been loaded. Load it.
AlprRecognizers recognizer; AlprRecognizers recognizer;
recognizer.plateDetector = createDetector(config); recognizer.plateDetector = createDetector(config, prewarp);
recognizer.ocr = new OCR(config); recognizer.ocr = new OCR(config);
#ifndef SKIP_STATE_DETECTION #ifndef SKIP_STATE_DETECTION