GithubHelp home page GithubHelp logo

automatic-plate-number-recognition-apnr's Introduction

Simple script to detect and recognize plate number (Automatic Plate Number Recognition - APNR)

Link to the .pdf report

Steps:

  1. Load image

  2. Apply blur filter (to remove noise)

  3. Convert blurred image to grayscale

  4. Apply Sobel filter to find vertical edges (car plates have a high density of vertical lines)

  5. Apply threshold with Ostu’s Binarization (Ostu’s binarization will automatically calculate optimal threshold from image histogram)

    steps 1-5

  6. Create a rectangular mask of size of 17x3 and apply “closing” filter to detect plate number more clearly

steps 1-5

  1. Find and fetch contours of possible plates
  2. Validate contours and clear out those, that can't be potential plate numbers
    • Is white color dominant?
    • Rotated not more than 15 degrees
    • In Europe, car plate size: 52x11, aspect 4,7272
    • Define min && max area of plate number
  3. After (8), apply dilate filter and threshold to validated contours to get numbers and characters

steps 7-9

cleaning plate number

10)Apply Tesseract to extract plate number as a text. Tesseract is an optical character recognition (OCR) engine sponsored by Google.

steps 10

Final Results

Final Results

automatic-plate-number-recognition-apnr's People

Contributors

kagan94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

egbert8165

automatic-plate-number-recognition-apnr's Issues

Compile Error [solved] I have to have my trained data file

I get this error when I try to run it

py -2 main.py

Traceback (most recent call last):
  File "main.py", line 353, in <module>
    process_single_image(images)
  File "main.py", line 305, in process_single_image
    plates, plates_images, mask = find_plate_numbers(img, contours, mask)
  File "main.py", line 263, in find_plate_numbers
    plate_text = image_to_string(plate_im, lang='eng')
  File "D:\Python27\lib\site-packages\pytesseract\pytesseract.py", line 309, in image_to_string
    }[output_type]()
  File "D:\Python27\lib\site-packages\pytesseract\pytesseract.py", line 308, in <lambda>
    Output.STRING: lambda: run_and_get_output(*args),
  File "D:\Python27\lib\site-packages\pytesseract\pytesseract.py", line 218, in run_and_get_output
    run_tesseract(**kwargs)
  File "D:\Python27\lib\site-packages\pytesseract\pytesseract.py", line 194, in run_tesseract
    raise TesseractError(status_code, get_errors(error_string))
pytesseract.pytesseract.TesseractError: (1, u'Tesseract Open Source OCR Engine v3.05.00dev with Leptonica Error opening data file D:\\Tesseract-OCR\\tessdata/eng.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory. Failed loading language \'eng\' Tesseract couldn\'t load any languages! Could not initialize tesseract.')

Which version do you use of all??

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.