AAKTUNotes

Number Plate Recognition with Automatic Challan

Reads a number plate from a photo, then stops and asks a person before any fine is raised - because a wrong reading means a wrong challan.

PythonFlaskMySQLadvanced5445 lines
999

One-time purchase — source code, database, the written report and everything below, all in a single ZIP.

95-page report (Word)PPTSynopsis16 diagrams

No account needed — pay & download instantly

Look inside the report

+83
more pages in the ZIP

Showing the first 12 pages of 95. Tap any page to read it full size — this is the actual Word file you get, not a mock-up.

Screenshots

Tap any screenshot to open it full size. These are from the project actually running — not mockups.

About this project

A working traffic challan system built around a number plate reader that was measured instead of assumed. A photo goes in, the plate is located, straightened, cut into characters, recognised, and checked against the Indian plate format - and then the system stops and puts the reading in front of a person.

That pause is the whole design. A wrong plate does not produce a wrong number on a screen; it produces a fine posted to somebody who was never there, weeks later, with no easy way to argue. A reading held back for review costs one operator one minute. The two mistakes are not equal, so a challan can only be raised against a plate a person has confirmed - and that rule lives in the server, not in a hidden button. The self test proves it by trying to raise one without confirmation and requiring the refusal.

Nothing here is a wrapper around a downloaded OCR. Tesseract is not used, because on Windows it is one more install that fails; the CRNN scene-text model was measured and rejected because it is 33 MB - larger than this entire project - and is built for signboards, not plates. Instead the characters are recognised by a 36-class classifier written in plain NumPy that ships as a 213 KB file, and its features come from a HOG implementation written by hand, because OpenCV removed HOGDescriptor in version 5 and a student's machine may have either version.

Every number in the report comes from evaluation/study.py, which runs six studies and writes results.json - and config.py reads its thresholds from that same file, so the system runs on what was measured, not on what felt right. Six of them: how each kind of damage degrades the reading, what each pipeline stage actually contributes, what straightening a tilted plate is worth, which characters get confused and how many of those the plate format fixes on its own, how per-character accuracy compounds over ten characters, and where the confidence threshold has to sit for automatic acceptance to be safe.

The studies changed the code more than once. Illumination flattening - a step in nearly every tutorial - was measured, found to add roughly 205 noise blobs per image while helping detection not at all, and removed. The auto-accept threshold of 0.99 was not chosen by feel; it is the point where automatic acceptance still covered 73% of readings with zero wrong acceptances in the corpus.

And what the system cannot do is on the About page inside the app, not buried in a footnote: a plate smeared by fast motion is unreadable at any threshold, and no amount of processing brings back strokes that are physically gone.

Features

  • Reads Indian number plates from a photo end to end - locate, straighten, segment, recognise, verify
  • Whole plate read exactly right 89.5% of the time on the evaluation corpus; 99.18% of individual characters
  • The tutorial contour-and-Canny detector scores 58.2% on the same images - a 31 point gap, measured side by side
  • A challan can never be raised from an unconfirmed reading, and the server enforces it (there is a test that tries)
  • What the machine read and what the operator decided are stored in two separate columns, so a correction can never quietly disappear
  • The dashboard shows how often a person had to correct the machine - the system reports its own error rate
  • Review queue sorted by confidence, so the readings most likely to be wrong are seen first
  • Indian plate grammar fixes O/0, I/1 and B/8 by position instead of guessing - worth 4.1 points of whole-plate accuracy
  • The state code is chosen as a whole unit against the real list, so an impossible code cannot survive
  • Series letters I and O are excluded because the RTO never issues them - exactly the two that look like digits
  • Auto-accept threshold of 0.99 was measured, not guessed: 73% of readings accepted with zero wrong acceptances
  • Perspective correction from the four detected corners, not a plain rectangular crop
  • Binarisation is chosen by its result - four methods are run and the one that produces a row of characters wins
  • One deskew retry when confidence is low, worth 7 points on tilted photographs
  • 36-class character classifier in plain NumPy - 213 KB, no PyTorch, no TensorFlow at runtime
  • HOG features written by hand, because OpenCV 5 removed HOGDescriptor and a student may have either version
  • No Tesseract and no dlib - one pip install and it runs, nothing compiles
  • Six evaluation studies write results.json, and config.py reads its thresholds from that file
  • Stolen and blacklisted vehicles raise an alert in the control room the moment the plate is read
  • Duplicate protection so a vehicle parked in front of a camera cannot collect forty challans
  • Public challan lookup with no login - and it never shows the owner's name, address or photo
  • Full audit log of who confirmed, corrected, issued and cancelled - this is what settles a dispute
  • PBKDF2-SHA256 passwords, parameterised SQL everywhere, role checks on the server
  • 36 automated self-tests that need no camera and no internet
  • What the system cannot do is stated inside the app, on its own page, with the numbers

Modules

Indian plate grammar (state codes, position rules)Synthetic plate and scene generator with exact ground truthPlate detection (character-first, plus the tutorial method for comparison)Perspective rectificationCharacter segmentationHOG features and 36-class classifierGrammar-aware decoding with confidenceEvaluation suite (six studies to results.json)Authentication and role guards (operator, officer, admin)Capture intake and review queueChallan issue, cancel, print and PDFVehicle registry with stolen and blacklist flagsCamera and violation mastersPublic challan lookup and paymentAlerts and full audit log

Tools

  • Python 3.8+
  • Flask (web framework)
  • OpenCV (image processing - no Tesseract, no dlib)
  • NumPy (the character classifier is written in plain NumPy)
  • MySQL / MariaDB (XAMPP works out of the box)
  • PyMySQL (database driver)
  • Pillow (plate rendering for the evaluation corpus)
  • VS Code (or any editor)
  • Any web browser

Requirements

Python 3.8 or newer, and MySQL. XAMPP is the easiest way to get MySQL - install it, open the Control Panel and press Start next to MySQL. Then one command installs the libraries: pip install -r requirements.txt (OpenCV, NumPy, Flask, PyMySQL and Pillow, about 70 MB). Nothing compiles, so no C++ build tools are needed on Windows, and there is no Tesseract or dlib to install. The trained character model ships inside the ZIP, so no download and no training is required to run it. The database and all its tables are created automatically on first run - there is no .sql file to import. No camera is needed: every screen works from an uploaded photo. Works on Windows, Linux and Mac.

How to run

1. Extract the ZIP.
2. Start MySQL - open the XAMPP Control Panel and press Start next to MySQL.
3. Open CMD and go to the folder:  cd path\to\number-plate-recognition
4. Install the libraries:  pip install -r requirements.txt
5. Check everything is ready:  python check_setup.py
6. Load the demo data:  python demo.py
7. Start the app:  python app.py
8. Open http://127.0.0.1:5000 in your browser.
9. Login:  admin / admin123   (administrator)   officer / officer123   operator / operator123

If MySQL uses a password on your machine, set it once before step 5:
    set NPR_DB_PASSWORD=yourpassword

Try it: log in as operator, open 'New Capture', and upload any of the photos in samples/. The plate is read in front of you with a confidence score, and the reading lands in the review queue.

Before a viva, run 'python selftest.py' - 36 checks pass in front of the examiner with no camera and no internet. To regenerate every number in the report from scratch, run 'python -m evaluation.study' (about 10 minutes) and then 'python train_classifier.py' if you want to retrain the character model as well.

The same steps are in README.md inside the ZIP, along with a troubleshooting table.

What you get in the ZIP

  • 📁 Full source code — commented throughout, so you can explain it in the viva
  • 🗄️ Database — the schema builds itself on first run, with sample data
  • 📖 README.md — step-by-step run instructions, database design and troubleshooting
  • 📄 Full project report (Word)Written out and formatted for AKTU — not an outline you have to fill in
  • 📊 Presentation (PPT)Ready for the final viva presentation
  • 📝 Synopsis (Word)The short write-up your guide asks for before approval
  • Viva questions with answersThe questions examiners actually ask about this project
  • 📐 16 ready-made diagrams — DFD, ER, use case, sequence and architecture, as images you can paste straight into the report
Share on WhatsApp

Other projects