Skip to content

A high recall Number Plate Detector System in Python and OpenCV

Notifications You must be signed in to change notification settings

saketk21/NumberPlateLocalization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NumberPlateLocalization

A high recall Number Plate Detector System in Python and OpenCV

Using Image Processing techniques with the help of Numpy and OpenCV libraries in Python, NumberPlateLocalization is a high recall Number Plate Detector in images of cars.

Usage:

For using NumberPlateLocalization through the Console, use the following command.

python NumberPlateLocalization.py [options]

Available Options:

The available options are as follows:

  1. Mode:

The Mode option is used to specify whether you want to write the output images of the application to a folder named FinalOutput. The default mode is None. To write output images to the HDD, use Write Mode by using --write.

  1. Show Steps:

The Show Steps option is used to show the intermediate steps of the Detector, i.e. the output images of the preprocessing logic of the application. The default mode is False. To show the intermediate steps, use Show Steps Mode by setting the showsteps flag like so: --showsteps

  1. All Images:

This is a default option of the Detector application, although it can be used explicitly for code clarity while direct usage in other codebases. Usage: --all.

  1. Single Image:

The Single Image option is used to specify a single image for the Detector to work on. The required argument for this option is the Image Name(specified along with extension) immediately following the --single flag. There must be an image of the provided name in the Dataset folder. Example usage is like so: --single FILENAME

  1. Multi Image:

The Multi Image option is used to specify a number of images from the Dataset on which the Detector will work. The required argument is a number following the --multi flag. For a valid number n, the Detector uses the first n images from the dataset. If the number specified exceeds the total images in the Dataset, the Detector defaults to the All Images option. Usage: --multi NUMBER

The options can be used in conjunction to create various combinations. Some examples below:

  • Detecting the plates of the first 10 images, and writing the output images to HDD:

python NumberPlateLocalization.py --multi 10 --write

  • Detecting the plate from an image named 21.png and showing the intermediate steps, and writing the output to HDD:

python NumberPlateLocalization.py --single 21.png --showsteps --write

Results:

The Detector works with fairly accurate results for most of the images in the dataset. Some results are as follows:

Success Image 1 Success Image 2 Success Image 3

However, the Detector fails for some images showing false positives or concave polygons over the Number Plate region.

Failure Image 1 Failure Image 1

The Detector results can be improved by using certain Machine Learning optimizations to choose the value of Epsilon for Polygon Approximation, applying a threshold for the Number of White Pixels per total pixels in the area of the detected contour etc.

About

A high recall Number Plate Detector System in Python and OpenCV

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages