diff --git a/runtime_data/ocr/tessdata/leu.traineddata b/runtime_data/ocr/tessdata/leu.traineddata index efa90a7..f22c3ee 100644 Binary files a/runtime_data/ocr/tessdata/leu.traineddata and b/runtime_data/ocr/tessdata/leu.traineddata differ diff --git a/runtime_data/ocr/tessdata/lus.traineddata b/runtime_data/ocr/tessdata/lus.traineddata index 2ab3d90..a187480 100644 Binary files a/runtime_data/ocr/tessdata/lus.traineddata and b/runtime_data/ocr/tessdata/lus.traineddata differ diff --git a/src/CPackConfig.cmake b/src/CPackConfig.cmake new file mode 100644 index 0000000..86c3dd5 --- /dev/null +++ b/src/CPackConfig.cmake @@ -0,0 +1,60 @@ +# This file will be configured to contain variables for CPack. These variables +# should be set in the CMake list file of the project before CPack module is +# included. Example variables are: +# CPACK_GENERATOR - Generator used to create package +# CPACK_INSTALL_CMAKE_PROJECTS - For each project (path, name, component) +# CPACK_CMAKE_GENERATOR - CMake Generator used for the projects +# CPACK_INSTALL_COMMANDS - Extra commands to install components +# CPACK_INSTALLED_DIRECTORIES - Extra directories to install +# CPACK_PACKAGE_DESCRIPTION_FILE - Description file for the package +# CPACK_PACKAGE_DESCRIPTION_SUMMARY - Summary of the package +# CPACK_PACKAGE_EXECUTABLES - List of pairs of executables and labels +# CPACK_PACKAGE_FILE_NAME - Name of the package generated +# CPACK_PACKAGE_ICON - Icon used for the package +# CPACK_PACKAGE_INSTALL_DIRECTORY - Name of directory for the installer +# CPACK_PACKAGE_NAME - Package project name +# CPACK_PACKAGE_VENDOR - Package project vendor +# CPACK_PACKAGE_VERSION - Package project version +# CPACK_PACKAGE_VERSION_MAJOR - Package project version (major) +# CPACK_PACKAGE_VERSION_MINOR - Package project version (minor) +# CPACK_PACKAGE_VERSION_PATCH - Package project version (patch) + +# There are certain generator specific ones + +# NSIS Generator: +# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Name of the registry key for the installer +# CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra commands used during uninstall +# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra commands used during install + + +## Debian package generator using CPack + +SET(CUR_SOURCE_DIR "/storage/projects/alpr/src") + +INCLUDE (InstallRequiredSystemLibraries) + +#SET (CPACK_SET_DESTDIR "on") +SET (CPACK_PACKAGING_INSTALL_PREFIX "/usr") +SET (CPACK_GENERATOR "DEB;TGZ;RPM") + +SET (CPACK_PACKAGE_NAME "openalpr") + +SET(CPACK_PACKAGE_VERSION "1.1.1") + +SET(CPACK_INSTALL_CMAKE_PROJECTS "${CUR_SOURCE_DIR}/build;src;ALL;/") +SET(CPACK_CMAKE_GENERATOR "Unix Makefiles") + +#SET (${VERSION} CPACK_DEBIAN_PACKAGE_VERSION) +SET (CPACK_DEBIAN_PACKAGE_PRIORITY "optional") +SET (CPACK_DEBIAN_PACKAGE_SECTION "graphics") +SET (CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) +SET (CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.1.3), libgcc1 (>= 4.1.1), libtesseract3 (>= 3.0.3), libopencv-core2.4 (>= 2.4.8), libopencv-objdetect2.4 (>= 2.4.8), libopencv-highgui2.4 (>= 2.4.8), libopencv-imgproc2.4 (>= 2.4.8), libopencv-flann2.4 (>= 2.4.8), libopencv-features2d2.4 (>= 2.4.8)") + +SET (CPACK_RESOURCE_FILE_LICENSE "${CUR_SOURCE_DIR}/../LICENSE") +SET (CPACK_PACKAGE_DESCRIPTION "OpenALPR - Open Source Automatic License Plate Recognition") +SET (CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenALPR is an open source Automated License Plate Recognition library written in C++. The library analyzes images and identifies license plates. The output is the text representation of any license plate characters found in the image. Check out a live online demo here: http://www.openalpr.com/demo.html" ) +SET (CPACK_PACKAGE_CONTACT "matt@ndu.com") +SET (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_ARCHITECTURE}") + +SET (CPACK_COMPONENTS_ALL Libraries ApplicationData) +#INCLUDES (CPack Documentation) diff --git a/src/misc_utilities/CMakeLists.txt b/src/misc_utilities/CMakeLists.txt index d2c948b..2f5c164 100644 --- a/src/misc_utilities/CMakeLists.txt +++ b/src/misc_utilities/CMakeLists.txt @@ -24,6 +24,7 @@ ADD_EXECUTABLE( benchmark benchmark.cpp ) TARGET_LINK_LIBRARIES(benchmark openalpr-static support + pthread ${OpenCV_LIBS} ${Tesseract_LIBS} ) @@ -35,4 +36,4 @@ TARGET_LINK_LIBRARIES(prepcharsfortraining ${OpenCV_LIBS} ) - \ No newline at end of file + diff --git a/src/openalpr/config.cpp b/src/openalpr/config.cpp index 3ab1333..79c66bf 100644 --- a/src/openalpr/config.cpp +++ b/src/openalpr/config.cpp @@ -171,7 +171,7 @@ string Config::getPostProcessRuntimeDir() } string Config::getTessdataPrefix() { - return "TESSDATA_PREFIX=" + this->runtimeBaseDir + "/ocr/"; + return this->runtimeBaseDir + "/ocr/"; } diff --git a/src/openalpr/ocr.cpp b/src/openalpr/ocr.cpp index dde363b..6545230 100644 --- a/src/openalpr/ocr.cpp +++ b/src/openalpr/ocr.cpp @@ -28,14 +28,8 @@ OCR::OCR(Config* config) tesseract=new TessBaseAPI(); // Tesseract requires the prefix directory to be set as an env variable - vector tessdataPrefix(config->getTessdataPrefix().size() + 1); - - strcpy(tessdataPrefix.data(), config->getTessdataPrefix().c_str()); - putenv(tessdataPrefix.data()); - - tesseract->Init("", config->ocrLanguage.c_str() ); + tesseract->Init(config->getTessdataPrefix().c_str(), config->ocrLanguage.c_str() ); tesseract->SetVariable("save_blob_choices", "T"); - //tesseract->SetVariable("tessedit_char_whitelist", "ABCDEFGHIJKLMNPQRSTUVWXYZ1234567890"); tesseract->SetPageSegMode(PSM_SINGLE_CHAR); }