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:
1-9
to add different types of vehicles.Space Bar
to start/stop the vehicle movement.Enter
to process an image for license plate detection.i
for instructions.p
for toll prices.q
to exit and show the total collected toll.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