Progarm 1 => Number Plate Detection and OCR (Optical Character Recognition)
Program 2 => Parking-Space-Counter
======================================================================================
#Progarm 1 => Number Plate Detection and OCR (Optical Character Recognition) 🚗 This Python script detects number plates in a video stream, highlights them, and performs OCR to extract text from the detected number plates. 🚗
-
Clone the Repository:
git clone https://github.com/ShreyasPrabhu26/Number-Plate-Detection-and-OCR
-
Install Dependencies:
- OpenCV: For capturing video frames and image processing.
- PyTesseract: For OCR (Optical Character Recognition).
- Pillow (PIL): For opening and processing images.
You can install these dependencies using pip
:
pip install -r requirements.txt
- Tesseract OCR Engine:
Download and install the Tesseract OCR engine from https://github.com/UB-Mannheim/tesseract/wiki. Ensure that you set the correct path to the Tesseract executable (pytesseract.pytesseract.tesseract_cmd
) in the script.
- Run the Script:
python main.py
- Usage:
- The script captures video from the primary camera (you can adjust the camera source in the script).
- Detected number plates are highlighted in green rectangles, and "Number Plate" text is displayed above them.
- To save a detected number plate for OCR, press 's'.
- OCR is performed on the saved number plate image, and the extracted text is saved to the
extracted_text.txt
file. - Press 'q' to exit the script.
- Output:
- The extracted text from the number plates is saved in
extracted_text.txt
.
- Enjoy! 🚗
Feel free to customize and extend this script to suit your specific needs. Happy coding! 😊👍
=========================================================================================
First open the folder (Parking Space Counter) and install all the dependencies required to run these programs 2. Install Dependencies:
- OpenCV: For capturing video frames and image processing.
- PyTesseract: For OCR (Optical Character Recognition).
- Pillow (PIL): For opening and processing images.
- cvzone: A computer vision library used for various computer vision tasks and utilities.
You can install these dependencies using pip
:
pip install -r requirements.txt
This Python script allows you to define and manage parking spaces in an image interactively.
-
[IMP]Run the script and allocate the Parking Space!:
python parkingSpacePicker.py
2 Terminate the Program after defining Parking Space
-
Run the Main Script
python main.py
-
[OPTIOANL]Adjust the Parameter in the dialog Box