GithubHelp home page GithubHelp logo

bunnysworld / license-plate-detection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sardhendu/license-plate-detection

0.0 1.0 0.0 5.65 MB

{Python}: Detect and extract the license plate of vehicles using Machine Learning and Image Processing Techniques

Python 100.00%

license-plate-detection's Introduction

Licence-Plate-Detection

This project aims to utilize Machine Learning and Image Processing techniques to detect/extract license plates of vehicle given an image.

Modules:

  • You would want to start with the module LP_Detect_main.py. Lets go one by one

    • This module is aimed to extract features from a license plate/non license plate and store them in the disk (Training Features).

    • Here, we manually create a small dataset by cropping out License plates from vehicle images and small set of random images (non-license plates).

    • Usual image processing techniques such as thresholding, standarization, erosion etc. are applied to the images.

    • We employ Histogram of Oriented Gradients (HOG) as a features extraction technique. In a nutshell, given an image (say 32x32x3) HOG would create a feature vector which can be consumed by a Machine Learning model. You could even experiment with simple features extraction technique such as Edges 32x32 = 1024x1, Flattening the image (32x32x3) into 3072x1 and use these vectors as an input to Machine learning Models.

      Module

    • From step 1 we already have our features, now all we have to do is send these features to a machine learning model to learn a reasonable boundary to separate License plates and Non-License plates.

    • In our case, the data is not very big, so we use Support Vector Machines as our machine learning model. SVM's with RBF kernel performs excellent with small data size and are robust to overfitting.

      Module:
      • Fetches the saved features and the corresponding label (license_plate or non-license plate) and sends it to the SVM model.
      • Stores the learned model into the disk to be used while cross validation and testing.
    • Now that we have a model in place we would want to validate the model to predict if a rectangular region is license plate or non-license plate
    • Note here we do not provide the whole image, but use manually extract license plates and random images to get a sense of the model performance
    • We have every thing set up. We have a good model too and have validated it against cross validation dataset. Now the aim is to extract all the license plate given a image containing vehicles.
    • We know that a license plate has visible edges. So, we extract all contours or region of interests (ROI) from a image, i.e (rectangles, circles polygon defined with intense edges).
    • We know that license plate are rectangular in shape, so we reshape/extend the ROI as rectangles. Note, for a given image we can have 100's or ROI of which only 2-3 would be license plate. So we have to classify all the ROI using our SVM model.
    • All the ROI's are send to the feature extractor module.
    • The generated features for each ROI are then send to the SVM classifier for classification.
    • A high probability (say >90%) indicates a ROI to be the license plate.
    • Finally we stash the ROI that have high probability of being a license plate into the disk for manual examination.

    Look HERE to get a sense of the directory name, so that you can run the model for yourself.

Snapshot of the process

Train:

Training data is manually created by taking a vehicle's image and cropping out the license plate image. Another simple way would be to extract all possible contours form the image (look at /Code/Classify.py) and save them in a directory. Then manually go an select the license plates. Below are some images of License plates used for Training.

License Plates:

Non License Plates

Test:

For testing, an image containing a vehicle image with its license plate was provided. Given the image we first extracted all the ROI's and then classify each ROI's as a license plate or not a license plate.

Test Images:

Contours Extracted (Region of Interest)

Region of interest classified as License Plate

A sample of Dataset is provided: Look under the directory folder "/DataSet" to get a sense of the dataset.

license-plate-detection's People

Contributors

sardhendu avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.