mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 09:36:51 +08:00
Changed library to point to a config file rather than runtime dir
runtime dir location is specified in the config file
This commit is contained in:
@@ -21,9 +21,19 @@
|
||||
|
||||
void plateAnalysisThread(void* arg);
|
||||
|
||||
AlprImpl::AlprImpl(const std::string country, const std::string runtimeDir)
|
||||
AlprImpl::AlprImpl(const std::string country, const std::string configFile)
|
||||
{
|
||||
config = new Config(country, runtimeDir);
|
||||
config = new Config(country, configFile);
|
||||
|
||||
// Config file or runtime dir not found. Don't process any further.
|
||||
if (config->loaded == false)
|
||||
{
|
||||
plateDetector = ALPR_NULL_PTR;
|
||||
stateIdentifier = ALPR_NULL_PTR;
|
||||
ocr = ALPR_NULL_PTR;
|
||||
return;
|
||||
}
|
||||
|
||||
plateDetector = new RegionDetector(config);
|
||||
stateIdentifier = new StateIdentifier(config);
|
||||
ocr = new OCR(config);
|
||||
@@ -37,9 +47,20 @@ AlprImpl::AlprImpl(const std::string country, const std::string runtimeDir)
|
||||
AlprImpl::~AlprImpl()
|
||||
{
|
||||
delete config;
|
||||
delete plateDetector;
|
||||
delete stateIdentifier;
|
||||
delete ocr;
|
||||
|
||||
if (plateDetector != ALPR_NULL_PTR)
|
||||
delete plateDetector;
|
||||
|
||||
if (stateIdentifier != ALPR_NULL_PTR)
|
||||
delete stateIdentifier;
|
||||
|
||||
if (ocr != ALPR_NULL_PTR)
|
||||
delete ocr;
|
||||
}
|
||||
|
||||
bool AlprImpl::isLoaded()
|
||||
{
|
||||
return config->loaded;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user