How l4hu/car-park-license-plate-recognition-system works
Project type and purpose
• This is a hybrid embedded + web-based application for automated license-plate recognition.
• The “micro_controller” folder contains firmware (C, STM32CubeMX) that runs on an MCU, likely handling sensor/camera interfacing and data acquisition.
• The “micro_processor” folder contains Python modules (detector.py, ocr_reader.py) plus a Flask-style web UI (templates/*.html) to run inference, OCR, manage plates, and serve dashboards.
File structure
Top-level
• README.md (empty)
• Src/
– micro_controller/
• .ioc project (STM32CubeMX configuration)
• main.c (firmware entry point)
– micro_processor/
• detector.py (object detection using best.pt model)
• ocr_reader.py (optical character recognition)
• plate_manager_wui.py (Flask app for dashboard, login, plate CRUD)
• templates/ (HTML views for dashboard, add_plate, logs, error pages)
• best.pt (pretrained detection model)
• main.py (app launcher or orchestrator)
Components
a. micro_controller
– Hardware block: MCU + camera/sensor interfaces
– Firmware block: STM32CubeMX-generated HAL + main.c state machine
– Communication interface: UART, SPI, or Ethernet to micro_processor
b. micro_processor
– Inference engine: detector.py (loads best.pt)
– OCR engine: ocr_reader.py
– Plate management service/API: endpoints in plate_manager_wui.py
– Web UI: HTML templates + Flask routing
– Data store: (implied) sqlite or file logs for plates & access logs
c. External users
– Web browser clients consuming the dashboard/login/add_plate UIs
Relationships and interactions
1. Camera data → MCU firmware (main.c)
2. MCU → micro_processor over serial or network
3. micro_processor detector.py inference → detected plate image
4. detector.py → ocr_reader.py → plate number string
5. plate_manager_wui.py stores results → data store
6. Web browser ↔ Flask app (HTTP requests/responses)
• Control flow:
• User triggers “add plate” from UI → HTTP POST → Flask endpoint → data store
Architectural patterns and design principles
• Embedded firmware: event-driven state machine
• Server side: MVC pattern via Flask (models: data store, views: templates, controllers: endpoints)
• Separation of concerns: detection vs. OCR vs. presentation vs. data persistence
• Modularization: each Python script is a single responsibility module
Technologies & frameworks
• STM32CubeMX, HAL libraries, C (micro_controller)
• Python 3, Flask, Jinja2 templates (micro_processor)
• PyTorch model (.pt) for detection
• OCR library (e.g., Tesseract) used in ocr_reader.py
• HTML/CSS for WUI