diff --git a/src/main.cpp b/src/main.cpp index 2e9d8c7..4eb859a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -52,10 +52,11 @@ int main( int argc, const char** argv ) std::string country; int topn; - TCLAP::CmdLine cmd("OpenAlpr Command Line Utility", ' ', OPENALPR_VERSION); + TCLAP::CmdLine cmd("OpenAlpr Command Line Utility", ' ', Alpr::getVersion()); TCLAP::UnlabeledValueArg fileArg( "image_file", "Image containing license plates", false, "", "image_file_path" ); + TCLAP::ValueArg countryCodeArg("c","country","Country code to identify (either us for USA or eu for Europe). Default=us",false, "us" ,"country_code"); TCLAP::ValueArg seekToMsArg("","seek","Seek to the specied millisecond in a video file. Default=0",false, 0 ,"integer_ms"); TCLAP::ValueArg runtimeDirArg("r","runtime_dir","Path to the OpenAlpr runtime data directory",false, "" ,"runtime_dir"); @@ -94,6 +95,7 @@ int main( int argc, const char** argv ) return 1; } + cv::Mat frame; Alpr alpr(country, runtimePath); diff --git a/src/openalpr/alpr.cpp b/src/openalpr/alpr.cpp index 715c53f..06d8f02 100644 --- a/src/openalpr/alpr.cpp +++ b/src/openalpr/alpr.cpp @@ -71,6 +71,11 @@ bool Alpr::isLoaded() return true; } +std::string Alpr::getVersion() +{ + return AlprImpl::getVersion(); +} + // Results code AlprResult::AlprResult() diff --git a/src/openalpr/alpr.h b/src/openalpr/alpr.h index 1200a51..b2e6fa0 100644 --- a/src/openalpr/alpr.h +++ b/src/openalpr/alpr.h @@ -23,7 +23,6 @@ #include #include -#define OPENALPR_VERSION "1.0" struct AlprPlate { @@ -77,6 +76,8 @@ class Alpr std::string toJson(const std::vector results); bool isLoaded(); + + static std::string getVersion(); private: AlprImpl* impl; diff --git a/src/openalpr/alpr_impl.cpp b/src/openalpr/alpr_impl.cpp index 9bdc144..e086e2b 100644 --- a/src/openalpr/alpr_impl.cpp +++ b/src/openalpr/alpr_impl.cpp @@ -352,3 +352,11 @@ void AlprImpl::setDefaultRegion(string region) this->defaultRegion = region; } +std::string AlprImpl::getVersion() +{ + std::stringstream ss; + + ss << OPENALPR_MAJOR_VERSION << "." << OPENALPR_MINOR_VERSION << "." << OPENALPR_PATCH_VERSION; + return ss.str(); +} + diff --git a/src/openalpr/alpr_impl.h b/src/openalpr/alpr_impl.h index 2425e39..196e387 100644 --- a/src/openalpr/alpr_impl.h +++ b/src/openalpr/alpr_impl.h @@ -22,6 +22,7 @@ #define ALPRIMPL_H #include +#include #include "alpr.h" #include "config.h" @@ -32,6 +33,8 @@ #include "charactersegmenter.h" #include "ocr.h" +#include "constants.h" + #include "cjson.h" #include @@ -59,6 +62,7 @@ class AlprImpl void setDefaultRegion(string region); std::string toJson(const vector results); + static std::string getVersion(); Config* config; diff --git a/src/openalpr/constants.h b/src/openalpr/constants.h index f749a05..30e21b5 100644 --- a/src/openalpr/constants.h +++ b/src/openalpr/constants.h @@ -16,6 +16,9 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ +#define OPENALPR_MAJOR_VERSION 1 +#define OPENALPR_MINOR_VERSION 1 +#define OPENALPR_PATCH_VERSION 0 #define CONFIG_FILE "/openalpr.conf" #define KEYPOINTS_DIR "/keypoints"