mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 23:32:54 +08:00
Added library initialization time. Resolves issue #161
This commit is contained in:
@@ -29,6 +29,10 @@ namespace alpr
|
|||||||
{
|
{
|
||||||
AlprImpl::AlprImpl(const std::string country, const std::string configFile, const std::string runtimeDir)
|
AlprImpl::AlprImpl(const std::string country, const std::string configFile, const std::string runtimeDir)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
timespec startTime;
|
||||||
|
getTimeMonotonic(&startTime);
|
||||||
|
|
||||||
config = new Config(country, configFile, runtimeDir);
|
config = new Config(country, configFile, runtimeDir);
|
||||||
|
|
||||||
plateDetector = ALPR_NULL_PTR;
|
plateDetector = ALPR_NULL_PTR;
|
||||||
@@ -51,7 +55,12 @@ namespace alpr
|
|||||||
setDefaultRegion("");
|
setDefaultRegion("");
|
||||||
|
|
||||||
prewarp = new PreWarp(config);
|
prewarp = new PreWarp(config);
|
||||||
|
|
||||||
|
timespec endTime;
|
||||||
|
getTimeMonotonic(&endTime);
|
||||||
|
if (config->debugTiming)
|
||||||
|
cout << "OpenALPR Initialization Time: " << diffclock(startTime, endTime) << "ms." << endl;
|
||||||
|
|
||||||
}
|
}
|
||||||
AlprImpl::~AlprImpl()
|
AlprImpl::~AlprImpl()
|
||||||
{
|
{
|
||||||
@@ -559,12 +568,22 @@ namespace alpr
|
|||||||
|
|
||||||
void AlprImpl::setDetectRegion(bool detectRegion)
|
void AlprImpl::setDetectRegion(bool detectRegion)
|
||||||
{
|
{
|
||||||
|
|
||||||
this->detectRegion = detectRegion;
|
this->detectRegion = detectRegion;
|
||||||
if (detectRegion && this->stateIdentifier == NULL)
|
if (detectRegion && this->stateIdentifier == NULL)
|
||||||
{
|
{
|
||||||
|
timespec startTime;
|
||||||
|
getTimeMonotonic(&startTime);
|
||||||
|
|
||||||
this->stateIdentifier = new StateIdentifier(this->config);
|
this->stateIdentifier = new StateIdentifier(this->config);
|
||||||
|
|
||||||
|
timespec endTime;
|
||||||
|
getTimeMonotonic(&endTime);
|
||||||
|
if (config->debugTiming)
|
||||||
|
cout << "State Identification Initialization Time: " << diffclock(startTime, endTime) << "ms." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
void AlprImpl::setTopN(int topn)
|
void AlprImpl::setTopN(int topn)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user