License Plate Detection

License Plate detection has many practical uses since many process can be automated. This can be used in detecting license plate at toll plazas, automation of detecting license plate of vehicles by traffic police and penality can be imposed on the drivers who violate the traffic rules without human involvement. We have done the basic implementation of it and can be modified as per the requirement. The code and working of it is shown here.

The working of the project is demonstrated below

  • The image is taken as input using argparse.
  • Given image is converted into gray scale image
  • Black hat is applied on the obtained gray scale image and then it is followed by Threshold bianry inverse
  • Now Contours are drawn on the image in rectangular shape on the image which subsequently gives the co-ordinates of license plate
  • Crop the license plate with the obtained contours
  • Again apply tophat and binary thresholding on the obtained license plate
  • Now use image_to_string() method from Pytesseract which is used to extract the text from refined image.
  • Print the String and also it can be saved to a text file