- OpenCV
- Keras
- Darknet
- Numpy
- OS
- Glob
-
ANPR is an image-processing innovation which is used to perceive vehicles by their tags. This expertise is ahead of time ubiquity in security and traffic installation. Tag Recognition System is an application of PC vision. PC vision is a technique for using a PC to take out abnormal state information from a digital image. The useless homogeny among various tags for example, its dimension and the outline of the License Plate. The ALPR system consists of following steps:-
- Vehicle Image Capture
- Preprocessing
- Number Plate Extraction
- Character Segmentation
- Character Recognition
-
The ALPR system works in these strides, the initial step is the location of the vehicle and capturing a vehicle image of front or back perspective of the vehicle, the second step is the localization of Number Plate and then extraction of vehicle Number Plate is an image. The final stride use image segmentation strategy, for the segmentation a few techniques neural network, mathematical morphology, color analysis and histogram analysis. Segmentation is for individual character recognition. Optical Character Recognition (OCR) is one of the strategies to perceive the every character with the assistance of database stored for separate alphanumeric character.
In order to easily run the code, you must have installed the Keras framework with TensorFlow backend. The Darknet framework is self-contained in the "darknet" folder and must be compiled before running the tests. To build Darknet just type "make" in "darknet" folder:
$ cd darknet && make
The current version was tested in an Ubuntu 19.10 machine, with Keras 2.3.1, TensorFlow 1.14.0/2.1.0, OpenCV 4.2.0.32, NumPy 1.18.1 and Python 2.7.17.
After building the Darknet framework, you must execute the "get-networks.sh" script. This will download all the trained models:
$ bash get-networks.sh
Use the script "run.sh" to run our ALPR approach. It requires 3 arguments:
- Input directory (-i): should contain at least 1 image in JPG or PNG format;
- Output directory (-o): during the recognition process, many temporary files will be generated inside this directory and erased in the end. The remaining files will be related to the automatic annotated image;
- CSV file (-c): specify an output CSV file.
$ bash get-networks.sh && bash run.sh -i samples/test -o /tmp/output -c /tmp/output/results.csv
To train the LP detector network from scratch, or fine-tuning it for new samples, you can use the train-detector.py script. In folder samples/train-detector there are 3 annotated samples which are used just for demonstration purposes. To correctly reproduce our experiments, this folder must be filled with all the annotations provided in the training set, and their respective images transferred from the original datasets.
The following command can be used to train the network from scratch considering the data inside the train-detector folder:
$ mkdir models
$ python2 create-model.py eccv models/eccv-model-scracth
$ python2 train-detector.py --model models/eccv-model-scracth --name my-trained-model --train-dir samples/train-detector --output-dir models/my-trained-model/ -op Adam -lr .001 -its 300000 -bs 64
For fine-tuning, use your model with --model option.
We know that not everyone has an NVIDIA card available, and sometimes it is cumbersome to properly configure CUDA. Thus, we opted to set the Darknet makefile to use CPU as default instead of GPU to favor an easy execution for most people instead of a fast performance. Therefore, the vehicle detection and OCR will be pretty slow. If you want to accelerate them, please edit the Darknet makefile variables to use GPU.
-
Automatic license-plate recognition (ALPR) is a technology that uses optical character recognition on images to read vehicle registration plates. It can use existing closed-circuit television, road-rule enforcement cameras, or cameras specifically designed for the task. ALPR can be used by police forces around the world for law enforcement purposes, including to check if a vehicle is registered or licensed. It is also used for electronic toll collection on pay-per-use roads and as a method of cataloguing the movements of traffic, for example by highways agencies.
-
Automated License Plate Recognition has many uses including:
- Recovering stolen cars.
- Identifying drivers with an open warrant for arrest.
- Catching speeders by comparing the average time it takes to get from stationary camera A to stationary camera B.
- Determining what cars do and do not belong in a parking garage.
- Expediting parking by eliminating the need for human confirmation of parking passes.
@INPROCEEDINGS{silva2018a,
author={S. M. Silva and C. R. Jung},
booktitle={2018 European Conference on Computer Vision (ECCV)},
title={License Plate Detection and Recognition in Unconstrained Scenarios},
year={2018},
pages={580-596},
doi={10.1007/978-3-030-01258-8_36},
month={Sep},}