This repository contains the implementation of a vehicle counter system that detects and counts vehicles in different lanes. The project utilizes computer vision techniques powered by OpenCV and deep learning models with TensorFlow.
License Plate Detection.py: A script for detecting and recognizing license plates on vehicles.Vehicle Counting in Lanes.py: A script for detecting and counting vehicles in specified lanes.
Ensure you have the following installed:
- Python 3.x
- OpenCV
- TensorFlow
- Other dependencies as specified in
requirements.txt
You can install the required packages using pip:
pip install -r requirements.txt-
Clone this repository to your local machine:
git clone https://github.com/Navini11/vehicle-counter.git cd vehicle-counter -
Run the Vehicle Counting Script:
python Vehicle Counting in Lanes.py -
Run the License Plate Detection Script:
python License Plate Detection.py
The Vehicle Counting in Lanes.py script performs the following steps:
- Load Video Feed: Loads a video stream for vehicle detection.
- Preprocessing: Applies preprocessing techniques such as resizing and grayscale conversion.
- Vehicle Detection: Uses a pre-trained deep learning model to detect vehicles in each frame.
- Lane Assignment: Assigns detected vehicles to specific lanes based on their positions.
- Counting: Counts the number of vehicles in each lane and updates the count in real-time.
The License Plate Detection.py script includes:
- Load Image/Video Feed: Loads an image or video stream containing vehicles.
- Preprocessing: Applies preprocessing techniques such as resizing and grayscale conversion.
- License Plate Detection: Uses OpenCV to detect license plates on vehicles.
- Recognition: Recognizes the characters on the detected license plates using OCR.
-
Software:
- TensorFlow
- OpenCV
- Google Colab (for model training)
- Visual Studio Code
-
Hardware:
- Any standard computer with Python environment
- Successfully detected and counted vehicles in multiple lanes with high accuracy.
- Efficiently recognized and extracted license plate information from vehicles.
Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License - see the LICENSE file for details.