Table of Contents
LPR (License Plate Recognition), also known as ANPR (Automatic Number-Plate Recognition) is an image-processing technology used to identify vehicles by their license plates.
The system uses illumination and an infrared camera to take the image of the front or rear of the vehicle, then an image-processing software analyzes the images and extracts the license plate information.
Here's why LDR is valuable:
-
First of all, safety: the license plate serves as a virtual ticket, and grants free-flow access, preventing stolen cars or ticket swapping. Since ticket and license plate have to match at entry and exit, it is almost impossible to pursue fraudulent behaviors. With LPR you can also easily manage black lists and be in control of all the events and movements at entrance and exit.
-
LPR is highly reliable: in case of lost tickets, it is easy to determine the actual entry time from the license plate number.
-
In addition, LPR also allows multiple integrations and customizations, especially for contract parking where the recurrent user can smoothly access and egress the car park without any titles other than the vehicle license plate.
-
With LPR, it is also possible to enter with a pre-paid ticket, or use cashless solutions. Another benefit offered by LPR at entries/exits is the possibility to book a parking space in advance, to ensure the driver a hassle-free experience.
-
Last but not least, LPR can be retrofitted and added to existing solutions.
A list of commonly used resources that I find helpful are listed in the acknowledgements.
.
├── CMakeLists.txt
├── include
│ ├── ConstantsDetectChars.h
│ ├── ConstantsDetectPlates.h
│ ├── ConstantsIdentifyPlate.h
│ ├── ConstantsPreprocess.h
│ ├── DetectChars.h
│ ├── DetectPlates.h
│ ├── IdentifyPlate.h
│ ├── PossibleChar.h
│ ├── PossiblePlate.h
│ ├── Preprocess.h
│ └── ShowLicensePlateArgs.h
├── README.md
├── ressource
│ ├── image
│ │ ├── image10.png
│ │ ├── image11.png
│ │ ├── image12.png
│ │ ├── image13.png
│ │ ├── image14.png
│ │ ├── image15.png
│ │ ├── image16.png
│ │ ├── image1.png
│ │ ├── image2.png
│ │ ├── image3.png
│ │ ├── image4.png
│ │ ├── image5.png
│ │ ├── image6.png
│ │ ├── image7.png
│ │ ├── image8.png
│ │ ├── image9.png
│ │ ├── imgOriginalScene.png
│ │ ├── test2.png
│ │ └── test.png
│ └── xml
│ ├── classifications.xml
│ └── images.xml
└── src
├── demo
│ ├── CMakeLists.txt
│ └── Demo.cpp
└── lib
├── CMakeLists.txt
└── plate
├── DetectChars.cpp
├── DetectPlates.cpp
├── IdentifyPlate.cpp
├── PossibleChar.cpp
├── PossiblePlate.cpp
└── Preprocess.cpp
8 directories, 43 files
This is a sample code of how you may detect a license plate on a image. To get a local copy up and running follow these simple steps.
This is an example of how to list things you need to use the software and how to install them.
- cmake
sudo apt-get install cmake
- CPP standard:
CMAKE_CXX_STANDARD 17
- Install
gtk
andgtk3
module to accesscanberra-gtk-module
used byopencv imshow
sudo apt install libcanberra-gtk-module libcanberra-gtk3-module
- Install first
opencv4
cpp libraries at https://opencv.org/ - Clone the repo
git clone https://github.com/zoumson/LicensePlateDetection.git
- Go to the project directory source
cd LicensePlateDetection
- Create empty directories
build
,lib
,result
andbin
mkdir build && mkdir lib && mkdir bin && mkdir result && cd result && mkdir image && cd ..
- Generate the library
libplate.so
and move it tolib
and the exectutabledemo
and move it tobin
cd build && cmake .. && make && cd ..
- Install the library
libplate.so
to/usr/lib
cd build && sudo make install && cd ..
- Command line arguments
Car license plate detection
Usage: demo [params]
-?, -h, --help, --usage (value:true)
show help message
-c, --classifier (value:./ressource/xml/classifications.xml)
input classifier path
--ext, -n (value:png)
save image detected with detected plate extension
-i, --image (value:<none>)
input image path
--name, -p (value:image)
save image detected with detected plate name
-p, --path (value:./result/image/)
save image detected with detected plate path
-s, --show (value:false)
show detection steps
--save, -v (value:false)
save image with detected plate
-t, --train (value:./ressource/xml/images.xml)
input trained images path
- Run with an image in
./ressource/image
./bin/demo -i=./ressource/image/image6.png -v=true
- Back to the initial file structure configuration
rm -r bin build lib result
All the headers files are well docummented, read through the comments
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Adama Zouma - - stargue49@gmail.com
Project Link: https://github.com/zoumson/LicensePlateDetection