Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lock OpenALPR version used in Docker image #556
- Loading branch information
Showing
407 changed files
with
88,854 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.rhiot</groupId> | ||
<artifactId>rhiot-docker</artifactId> | ||
<version>0.1.5-SNAPSHOT</version> | ||
<relativePath>..</relativePath> | ||
</parent> | ||
<name>Rhiot :: Docker images :: OpenALPR</name> | ||
<artifactId>rhiot-docker-openalpr</artifactId> | ||
|
||
<licenses> | ||
<license> | ||
<name>The Apache License, Version 2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
</license> | ||
</licenses> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.jolokia</groupId> | ||
<artifactId>docker-maven-plugin</artifactId> | ||
<configuration> | ||
<images> | ||
<image> | ||
<name>rhiot/openalpr</name> | ||
<build> | ||
<tags> | ||
<tag>latest</tag> | ||
<tag>${project.version}</tag> | ||
<tag>${timestamp}</tag> | ||
</tags> | ||
<assembly> | ||
<dockerFileDir>2.2.0</dockerFileDir> | ||
</assembly> | ||
</build> | ||
</image> | ||
</images> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
To get started, <a href="https://cla-assistant.io/openalpr/openalpr">sign the Contributor License Agreement</a>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from ubuntu:14.04 | ||
|
||
# Install prerequisites | ||
run apt-get update && apt-get install -y \ | ||
build-essential \ | ||
cmake \ | ||
curl \ | ||
git \ | ||
libcurl3-dev \ | ||
libleptonica-dev \ | ||
liblog4cplus-dev \ | ||
libopencv-dev \ | ||
libtesseract-dev \ | ||
wget | ||
|
||
# Copy all data | ||
copy . /srv/openalpr | ||
|
||
# Setup the build directory | ||
run mkdir /srv/openalpr/src/build | ||
workdir /srv/openalpr/src/build | ||
|
||
# Setup the compile environment | ||
run cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc .. | ||
|
||
# Compile the library | ||
run make | ||
|
||
# Install the binaries/libraries to your local system (prefix is /usr) | ||
run make install | ||
|
||
workdir /data | ||
|
||
entrypoint ["alpr"] |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
openalpr | ||
======== | ||
|
||
OpenALPR is an open source *Automatic License Plate Recognition* library written in C++ with bindings in C#, Java, Node.js, and Python. The library analyzes images and video streams to identify license plates. The output is the text representation of any license plate characters. | ||
|
||
Check out a live online demo here: http://www.openalpr.com/demo-image.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") | ||
|
||
|
||
|
||
``` | ||
user@linux:~/openalpr$ alpr ./samplecar.png | ||
plate0: top 10 results -- Processing Time = 58.1879ms. | ||
- PE3R2X confidence: 88.9371 | ||
- PE32X confidence: 78.1385 | ||
- PE3R2 confidence: 77.5444 | ||
- PE3R2Y confidence: 76.1448 | ||
- P63R2X confidence: 72.9016 | ||
- FE3R2X confidence: 72.1147 | ||
- PE32 confidence: 66.7458 | ||
- PE32Y confidence: 65.3462 | ||
- P632X confidence: 62.1031 | ||
- P63R2 confidence: 61.5089 | ||
``` | ||
|
||
Detailed command line usage: | ||
|
||
``` | ||
user@linux:~/openalpr$ alpr --help | ||
USAGE: | ||
alpr [-c <country_code>] [--config <config_file>] [-n <topN>] [--seek | ||
<integer_ms>] [-p <pattern code>] [--clock] [-d] [-j] [--] | ||
[--version] [-h] <image_file_path> | ||
Where: | ||
-c <country_code>, --country <country_code> | ||
Country code to identify (either us for USA or eu for Europe). | ||
Default=us | ||
--config <config_file> | ||
Path to the openalpr.conf file | ||
-n <topN>, --topn <topN> | ||
Max number of possible plate numbers to return. Default=10 | ||
--seek <integer_ms> | ||
Seek to the specied millisecond in a video file. Default=0 | ||
-p <pattern code>, --pattern <pattern code> | ||
Attempt to match the plate number against a plate pattern (e.g., md | ||
for Maryland, ca for California) | ||
--clock | ||
Measure/print the total time to process image and all plates. | ||
Default=off | ||
-d, --detect_region | ||
Attempt to detect the region of the plate image. [Experimental] | ||
Default=off | ||
-j, --json | ||
Output recognition results in JSON format. Default=off | ||
--, --ignore_rest | ||
Ignores the rest of the labeled arguments following this flag. | ||
--version | ||
Displays version information and exits. | ||
-h, --help | ||
Displays usage information and exits. | ||
<image_file_path> | ||
Image containing license plates | ||
OpenAlpr Command Line Utility | ||
``` | ||
|
||
|
||
Binaries | ||
---------- | ||
|
||
Pre-compiled Windows binaries can be downloaded on the [releases page] (https://github.com/openalpr/openalpr/releases) | ||
|
||
Install OpenALPR on Ubuntu 14.04 x64 with the following commands: | ||
|
||
wget -O - http://deb.openalpr.com/openalpr.gpg.key | sudo apt-key add - | ||
echo "deb http://deb.openalpr.com/master/ openalpr main" | sudo tee /etc/apt/sources.list.d/openalpr.list | ||
sudo apt-get update | ||
sudo apt-get install openalpr openalpr-daemon openalpr-utils libopenalpr-dev | ||
|
||
Integrating the Library | ||
----------------------- | ||
|
||
OpenALPR is written in C++ and has bindings in C#, Python, Node.js, and Java. Please see this guide for examples showing how to run OpenALPR in your application: https://github.com/openalpr/openalpr/wiki/Integrating-OpenALPR | ||
|
||
Compiling | ||
----------- | ||
|
||
[![Build Status](https://travis-ci.org/openalpr/openalpr.svg?branch=master)](https://travis-ci.org/openalpr/openalpr) | ||
|
||
OpenALPR compiles and runs on Linux, Mac OSX and Windows. | ||
|
||
OpenALPR requires the following additional libraries: | ||
|
||
- Tesseract OCR v3.0.3 (https://code.google.com/p/tesseract-ocr/) | ||
- OpenCV v2.4.8+ (http://opencv.org/) | ||
|
||
After cloning this GitHub repository, you should download and extract Tesseract and OpenCV source code into their own directories. Compile both libraries. | ||
|
||
Please follow these detailed compilation guides for your respective operating system: | ||
|
||
* [Windows] (https://github.com/openalpr/openalpr/wiki/Compilation-instructions-(Windows)) | ||
* [Ubuntu Linux] (https://github.com/openalpr/openalpr/wiki/Compilation-instructions-(Ubuntu-Linux)) | ||
* [OS X] (https://github.com/openalpr/openalpr/wiki/Compilation-instructions-(OS-X)) | ||
* [Android] (https://github.com/sujaybhowmick/OpenAlprDroidApp) | ||
* [iOS] (https://github.com/twelve17/openalpr-ios) | ||
|
||
If all went well, there should be an executable named *alpr* along with *libopenalpr-static.a* and *libopenalpr.so* that can be linked into your project. | ||
|
||
Docker | ||
------ | ||
|
||
``` shell | ||
# Build docker image | ||
docker build -t openalpr https://github.com/openalpr/openalpr.git | ||
# Download test image | ||
wget http://plates.openalpr.com/h786poj.jpg | ||
# Run alpr on image | ||
docker run -it --rm -v $(pwd):/data:ro openalpr -c eu h786poj.jpg | ||
``` | ||
|
||
Questions | ||
--------- | ||
Please post questions or comments to the Google group list: https://groups.google.com/forum/#!forum/openalpr | ||
|
||
|
||
Contributions | ||
------------- | ||
Improvements to the OpenALPR library are always welcome. Please review the [OpenALPR design description](https://github.com/openalpr/openalpr/wiki/OpenALPR-Design) and get started. | ||
|
||
Code contributions are not the only way to help out. Do you have a large library of license plate images? If so, please upload your data to the anonymous FTP located at upload.openalpr.com. Do you have time to "tag" plate images in an input image or help in other ways? Please let everyone know by posting a note in the forum. | ||
|
||
|
||
License | ||
------- | ||
|
||
Affero GPLv3 | ||
http://www.gnu.org/licenses/agpl-3.0.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
In order to clarify the intellectual property license granted with Contributions from any person or entity, OpenALPR Technology, Inc. ("OpenALPR") must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of OpenALPR; it does not change your rights to use your own Contributions for any other purpose. | ||
|
||
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to OpenALPR. Except for the license granted herein to OpenALPR and recipients of software distributed by OpenALPR, You reserve all right, title, and interest in and to Your Contributions. | ||
|
||
Definitions. | ||
|
||
"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with OpenALPR. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. | ||
|
||
"Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to OpenALPR for inclusion in, or documentation of, any of the products owned or managed by OpenALPR (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to OpenALPR or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, OpenALPR for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution." | ||
|
||
Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to OpenALPR and to recipients of software distributed by OpenALPR a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works. | ||
|
||
Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to OpenALPR and to recipients of software distributed by OpenALPR a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed. | ||
|
||
You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to OpenALPR, or that your employer has executed a separate Corporate CLA with OpenALPR. | ||
|
||
You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions. | ||
|
||
You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. | ||
|
||
Should You wish to submit work that is not Your original creation, You may submit it to OpenALPR separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [[]named here]". | ||
|
||
You agree to notify OpenALPR of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect. |
26 changes: 26 additions & 0 deletions
26
dockerfiles/openalpr/src/main/docker/2.2.0/config/alprd.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[daemon] | ||
|
||
; country determines the training dataset used for recognizing plates. Valid values are: us, eu | ||
country = us | ||
|
||
; text name identifier for this location | ||
site_id = your-unique-sitename | ||
|
||
; Declare each stream on a separate line | ||
; each unique stream should be defined as stream = [url] | ||
|
||
stream = http://127.0.0.1/example_video_stream.mjpeg | ||
;stream = http://127.0.0.1/example_second_stream.mjpeg | ||
;stream = webcam | ||
|
||
; topn is the number of possible plate character variations to report | ||
topn = 10 | ||
|
||
; Determines whether images that contain plates should be stored to disk | ||
store_plates = 0 | ||
store_plates_location = /var/lib/openalpr/plateimages/ | ||
|
||
; upload address is the destination to POST to | ||
upload_data = 0 | ||
upload_address = http://localhost:9000/push/ | ||
|
80 changes: 80 additions & 0 deletions
80
dockerfiles/openalpr/src/main/docker/2.2.0/config/openalpr.conf.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
|
||
; Specify the path to the runtime data directory | ||
runtime_dir = ${CMAKE_INSTALL_PREFIX}/share/openalpr/runtime_data | ||
|
||
|
||
ocr_img_size_percent = 1.33333333 | ||
state_id_img_size_percent = 2.0 | ||
|
||
; Calibrating your camera improves detection accuracy in cases where vehicle plates are captured at a steep angle | ||
; Use the openalpr-utils-calibrate utility to calibrate your fixed camera to adjust for an angle | ||
; Once done, update the prewarp config with the values obtained from the tool | ||
prewarp = | ||
|
||
; detection will ignore plates that are too large. This is a good efficiency technique to use if the | ||
; plates are going to be a fixed distance away from the camera (e.g., you will never see plates that fill | ||
; up the entire image | ||
max_plate_width_percent = 100 | ||
max_plate_height_percent = 100 | ||
|
||
; detection_iteration_increase is the percentage that the LBP frame increases each iteration. | ||
; It must be greater than 1.0. A value of 1.01 means increase by 1%, 1.10 increases it by 10% each time. | ||
; So a 1% increase would be ~10x slower than 10% to process, but it has a higher chance of landing | ||
; directly on the plate and getting a strong detection | ||
detection_iteration_increase = 1.1 | ||
|
||
; The minimum detection strength determines how sure the detection algorithm must be before signaling that | ||
; a plate region exists. Technically this corresponds to LBP nearest neighbors (e.g., how many detections | ||
; are clustered around the same area). For example, 2 = very lenient, 9 = very strict. | ||
detection_strictness = 3 | ||
|
||
; The detection doesn't necessarily need an extremely high resolution image in order to detect plates | ||
; Using a smaller input image should still find the plates and will do it faster | ||
; Tweaking the max_detection_input values will resize the input image if it is larger than these sizes | ||
; max_detection_input_width/height are specified in pixels | ||
max_detection_input_width = 1280 | ||
max_detection_input_height = 720 | ||
|
||
; detector is the technique used to find license plate regions in an image. Value can be set to | ||
; lbpcpu - default LBP-based detector uses the system CPU | ||
; lbpgpu - LBP-based detector that uses Nvidia GPU to increase recognition speed. | ||
; lbpopencl - LBP-based detector that uses OpenCL GPU to increase recognition speed. Requires OpenCV 3.0 | ||
; morphcpu - Experimental detector that detects white rectangles in an image. Does not require training. | ||
detector = lbpcpu | ||
|
||
; If set to true, all results must match a postprocess text pattern if a pattern is available. | ||
; If not, the result is disqualified. | ||
must_match_pattern = 0 | ||
|
||
; Bypasses plate detection. If this is set to 1, the library assumes that each region provided is a likely plate area. | ||
skip_detection = 0 | ||
|
||
max_plate_angle_degrees = 15 | ||
|
||
ocr_min_font_point = 6 | ||
|
||
; Minimum OCR confidence percent to consider. | ||
postprocess_min_confidence = 65 | ||
|
||
; Any OCR character lower than this will also add an equally likely | ||
; chance that the character is incorrect and will be skipped. Value is a confidence percent | ||
postprocess_confidence_skip_level = 80 | ||
|
||
|
||
debug_general = 0 | ||
debug_timing = 0 | ||
debug_detector = 0 | ||
debug_state_id = 0 | ||
debug_plate_lines = 0 | ||
debug_plate_corners = 0 | ||
debug_char_segment = 0 | ||
debug_char_analysis = 0 | ||
debug_color_filter = 0 | ||
debug_ocr = 0 | ||
debug_postprocess = 0 | ||
debug_show_images = 0 | ||
debug_pause_on_frame = 0 | ||
|
||
|
||
|
||
|
12 changes: 12 additions & 0 deletions
12
dockerfiles/openalpr/src/main/docker/2.2.0/distros/debian/README.source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
This package uses quilt to manage all modifications to the upstream source. | ||
Changes are stored in the source package as diffs in debian/patches and applied | ||
during the build. | ||
|
||
See /usr/share/doc/quilt/README.source for a detailed explanation. | ||
|
||
|
||
This package uses the version 3.0 of the debian source package; An upstream | ||
tarball is required to build it. This tarball can be generated automagically by | ||
downloading the sources from the github repository with the following command: | ||
|
||
fakeroot debian/rules get-orig-source |
Oops, something went wrong.