diff --git a/README.md b/README.md index 4f2d1dc..8f454da 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,34 @@ Check out a live online demo here: http://www.openalpr.com/demo.html User Guide ----------- + OpenALPR includes a command line utility. Simply typing "alpr [image file path]" is enough to get started recognizing license plate images. +For example, the following output is created by analyzing this image: +![Plate Image](http://www.openalpr.com/images/demoscreenshots/plate3.png "Input image") + + +The library is told that this is a Missouri (MO) license plate which validates the plate letters against a regional template. + +``` +user@linux:~/openalpr$ alpr ./samplecar.png -t mo -r ~/openalpr/runtime_dir/ + +plate0: top 10 results -- Processing Time = 58.1879ms. + - PE3R2X confidence: 88.9371 template_match: 1 + - PE32X confidence: 78.1385 template_match: 0 + - PE3R2 confidence: 77.5444 template_match: 0 + - PE3R2Y confidence: 76.1448 template_match: 1 + - P63R2X confidence: 72.9016 template_match: 0 + - FE3R2X confidence: 72.1147 template_match: 1 + - PE32 confidence: 66.7458 template_match: 0 + - PE32Y confidence: 65.3462 template_match: 0 + - P632X confidence: 62.1031 template_match: 0 + - P63R2 confidence: 61.5089 template_match: 0 + +``` + +Detailed command line usage: + ``` user@linux:~/openalpr$ alpr --help @@ -66,31 +92,11 @@ Where: OpenAlpr Command Line Utility ``` -For example, the following output is created by analyzing the plate image at this URL: http://www.openalpr.com/images/demoscreenshots/plate3.png - -The library is told that this is a Missouri (MO) license plate which validates the plate letters against a regional template. - -``` -user@linux:~/openalpr$ alpr ./samplecar.png -t mo -r ~/openalpr/runtime_dir/ - -plate0: top 10 results -- Processing Time = 58.1879ms. - - PE3R2X confidence: 88.9371 template_match: 1 - - PE32X confidence: 78.1385 template_match: 0 - - PE3R2 confidence: 77.5444 template_match: 0 - - PE3R2Y confidence: 76.1448 template_match: 1 - - P63R2X confidence: 72.9016 template_match: 0 - - FE3R2X confidence: 72.1147 template_match: 1 - - PE32 confidence: 66.7458 template_match: 0 - - PE32Y confidence: 65.3462 template_match: 0 - - P632X confidence: 62.1031 template_match: 0 - - P63R2 confidence: 61.5089 template_match: 0 - -``` Compiling ----------- -OpenALPR has been compiled successfully on Linux, however other operating systems should also work. +OpenALPR compiles and runs on Linux, Mac OSX and Windows. OpenALPR requires the following additional libraries: @@ -101,13 +107,13 @@ After cloning this GitHub repository, you should download and extract Tesseract Update the src/CMakeLists.txt file in the OpenALPR project. Update the following lines to match the directories of your libraries on your system: - * SET(OpenCV_DIR "../libraries/opencv/") - * SET(Tesseract_DIR "/home/mhill/projects/alpr/libraries/tesseract-ocr") + - SET(OpenCV_DIR "../libraries/opencv/") + - SET(Tesseract_DIR "/home/mhill/projects/alpr/libraries/tesseract-ocr") Finally, in the src directory, execute the following commands: - * cmake ./ - * make + - cmake ./ + - make If all went well, there should be an executable named *alpr* along with *libopenalpr.a* that can be linked into your project. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 06628d5..36cc41d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,14 +7,16 @@ IF (WIN32) add_definitions( -DWINDOWS) add_definitions( -DNOMINMAX) - SET(OpenCV_DIR "C:\\projects\\alpr\\libraries\\opencv") - SET(Tesseract_DIR "C:\\projects\\alpr\\libraries\\tesseract-3.02") + SET(OpenCV_DIR "C:\\projects\\openalpr\\libraries\\opencv") + SET(Tesseract_DIR "C:\\projects\\openalpr\\libraries\\tesseract-ocr") include_directories( - ${Tesseract_DIR}/include/tesseract - + ${Tesseract_DIR}/api + ${Tesseract_DIR}/ccutil/ + ${Tesseract_DIR}/ccstruct/ + ${Tesseract_DIR}/ccmain/ ) - link_directories( ${Tesseract_DIR}/lib/ ) + link_directories( ${Tesseract_DIR}/vs2008/LIB_Release/ ) ELSE() SET(OpenCV_DIR "../libraries/opencv/") @@ -43,13 +45,34 @@ include_directories(./openalpr ) set(CMAKE_CSS_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall ") ADD_EXECUTABLE( alpr main.cpp ) -TARGET_LINK_LIBRARIES(alpr - openalpr - support - ${OpenCV_LIBS} - tesseract - ) - + + +IF (WIN32) + # Extra linker dependencies for Windows + TARGET_LINK_LIBRARIES(alpr + openalpr + support + ${OpenCV_LIBS} + libtesseract302-static + liblept168 + liblept168-static-mtdll + libpng143-static-mtdll + libjpeg8c-static-mtdll + giflib416-static-mtdll + libtiff394-static-mtdll + zlib125-static-mtdll + ws2_32.lib + ) + +ELSE() + + TARGET_LINK_LIBRARIES(alpr + openalpr + support + ${OpenCV_LIBS} + tesseract + ) +ENDIF() add_subdirectory(openalpr) add_subdirectory(misc_utilities)