The Number Plate Detection System is a Python-based application that detects and extracts vehicle number plates from real-time video streams using OpenCV and Tesseract OCR. It captures the number plate, processes it to extract text, and stores the information along with timestamps in an Excel file.
This project is developed under the guidance of Dr. Gargi Shrivastav.
- Real-time number plate detection using Haar Cascade classifiers.
- OCR extraction to recognize text from number plates.
- Data logging: Plate numbers along with timestamps are saved in an Excel file.
- Error correction for common OCR misreadings (e.g., 'O' vs '0', 'I' vs '1').
- Graphical interface to display the detection process in real time.
-
Clone the repository:
git clone https://github.com/shivamyadavrgipt/number-plate-detection.git cd number-plate-detection -
Install Python dependencies:
pip install -r requirements.txt
-
Set up Tesseract OCR:
- Download and install Tesseract OCR from here.
- Update the Tesseract executable path in your script:
pytesseract.pytesseract.tesseract_cmd = r'path_to_tesseract/tesseract.exe'
-
Download the Haar Cascade:
- Download the Haar Cascade for number plate detection from here.
- Place the downloaded file in the
model/directory.
-
Run the main script:
python main.py
-
Controls:
- Press S to save the detected number plate image and extract text.
- Press Q to quit the program.
Below is an example of a detected number plate and the processed image:
(Include a sample image of detection here)
- The system logs:
- Detection of number plates.
- OCR extraction and error correction.
- Saving of the extracted number plate data into an Excel file.
- Logs are displayed in the terminal.
- Programming Language: Python 3.x
- Libraries:
- OpenCV: Image processing and real-time display.
- Tesseract OCR: Text extraction from images.
- Pandas: Data logging to Excel.
- NumPy: For numerical operations.
- OCR Accuracy: May vary depending on the quality of the image or plate visibility.
- Common OCR Errors: Characters like 'O' might be recognized as '0', and 'I' as '1'. These are handled with basic corrections.
This project is licensed under the MIT License. See the LICENSE file for more details.
- Thanks to OpenCV for the image processing framework.
- Thanks to Tesseract OCR for enabling text extraction from images.
Feel free to contribute to this project and enhance the features! 😊