openalpr
Automatic License Plate Recognition library
An open source library and command-line tool that reads license plate numbers from photos or video, returning the plate text and a confidence score, with bindings for six programming languages.
OpenALPR is an open source library that reads license plate numbers from images and video. You point it at a photo of a car, and it returns the text on the plate along with a confidence score. It can process a single image, a video file, or a live video stream.
The tool is available as a command-line program called alpr. Running it on an image takes a single command, and it outputs a ranked list of the most likely plate readings. For example, given an image of a plate that reads PE3R2X, it might return ten candidates in order of confidence, with the correct reading at the top. There is also a JSON output mode for integrating results into other software, and a clock mode that reports how long processing took.
The library is written in C++ and has bindings for Python, Node.js, Java, C#, and Go, so developers can call it from many programming languages. It supports plate formats for both the US and Europe, and optionally lets you specify a regional pattern (such as a US state) to improve accuracy by filtering results against known plate formats. Community-maintained ports also exist for Android and iOS.
On Linux, installation is a single apt-get command. On Windows, pre-compiled binaries are available. Building from source requires two additional libraries: Tesseract OCR (for character recognition) and OpenCV (for image processing). Docker is also supported with a one-liner build-and-run workflow.
The license is Affero GPLv3, which requires that derivative works also be open source. A commercial license is available for businesses that need different terms.
Where it fits
- Build a parking lot system that automatically reads vehicle license plates from camera feeds.
- Add license plate recognition to a security or surveillance application using Python or Node.js bindings.
- Process a batch of vehicle images and extract plate numbers as JSON for storage in a database.
- Integrate plate reading into a mobile app via the community Android or iOS ports.