This project demonstrates a toll collection system using OpenCV for image processing, Tesseract for OCR, and FreeGLUT for OpenGL rendering.
Make sure you have the required libraries installed. Open a terminal and run the following commands:
sudo apt install build-essential cmake pkg-config
sudo apt install libopencv-dev
sudo apt install tesseract-ocr libtesseract-dev libleptonica-dev
sudo apt install freeglut3 freeglut3-dev
sudo apt install libglu1-mesa libglu1-mesa-dev mesa-common-dev
sudo apt install tesseract-ocr-eng
Save the following code as toll_collection.cpp
:
// Add toll_collection.cpp C++ code here
Run the following command to compile the program:
g++ -o toll_collection toll_collection.cpp -lGL -lGLU -lglut `pkg-config --cflags --libs opencv4` -ltesseract -llept
Execute the compiled program with:
./toll_collection
Use the keyboard as described in the code comments:
- Press
1-9
to add different types of vehicles. - Press
Space Bar
to start/stop the vehicle movement. - Press
Enter
to process an image for license plate detection. - Press
i
for instructions. - Press
p
for toll prices. - Press
q
to exit and show the total collected toll.
- Missing Image: Ensure the image path provided in the code exists. If not, change the path to an existing image.
- Compilation Errors: If you encounter any errors during compilation, ensure all dependencies are correctly installed, and paths are correctly set.
Starting Window
Home Page
Instructions Window
Vehicle Toll Prices
Vehicles Starting Point
Vehicle Movement
Total Amount Collected
Sample Number Plate 1
Number Plate Recognition
Sample Number Plate 2
Number Plate Recognition