Inspiration
I just wanted to create something that helps improve traffic flow in major cities. Then, I got the idea of creating Elvvo, an all-in-one traffic solution that helps you to automatically change the lights according to the traffic density.
It also has other features like determining the speed of vehicles or storing criminal data on vehicles using their license number.
One more thing, I couldn't possibly work on this project without the support from my school "Alpine Public School". Their website is this. My school is the one that got me the equipment I needed to complete my project, and without them, I don't think I could've participated in this hackathon.
What It Does
As it is an all-in-one traffic solution, the features are as follows:
It changes the lights according to the traffic density as given in the images which are randomly selected by the program. The program randomly selects images, calculates the traffic density, and says whether it has low, high, or very high traffic.
It determines the speed of vehicles in a given video. A video is loaded and the speed of each vehicle is calculated and the speed (in km/h) will be written in white text right above the vehicle.
There are a bunch of license plates and Elvvo randomly selects one, processes the image, and tries to extract the license number as a String. Then, you can create some kind of a criminal record (JSON File) that will be associated with that license number.
How I Built It
This application is purely written in Python. For the main GUI, I used PyQt5. For the images and videos, I downloaded those and used them in the programs. For the criminal records, I used JSON to store the license numbers, list of crimes, and the fine.
For the computer vision and OCR (Optical Character Recognition), I used OpenCV and PyTesseract (TesseractOCR) respectively.
Challenges I Ran Into
There were a lot of challenges that I ran into. One was to download all the images and videos. Most of the media that I downloaded were either corrupt or not compatible with the program. It at least took me 2 hours to find the proper media that I needed.
When I developed the 'Speed' functionality, it was not quite fetching the speeds of every passing vehicle. So, it took me a lot of time to find correct pre-trained models of these cars and add them to the programs.
The last challenge was to add the data to the JSON files and try to modify/edit the data because, in the beginning, I was planning to put all the data in one JSON file itself, but then I got the idea to create different JSON files for different license numbers. Also, there was something wrong with the configuration of my raspberry pi, so I had to do the whole thing again from scratch (but I had backed up all the code on my laptop).
Accomplishments that I'm Proud Of
I was successfully getting the traffic density data to finish my program. I was also proud when I finally finished extracting the license numbers and trying to get the speed of the vehicles.
What I Learned
I learned how computer vision works (OpenCV) and OCR (TesseractOCR). I also learned how to manage JSON data and create Python GUI's.
What's Next for Elvvo
Well, this is just a prototype and I may include more features like catching the speed of the vehicles through a camera or accurately identifying the license number and traffic density on an actual street. One thing I am actually looking forward to is to create a database with license numbers, the vehicle's owner's email, name, address, etc. and try to send reminders/alerts through emails/SMS if that person got a ticket or a fine, or if they paid one already. It's something like getting personalized alerts.
Built With
- api
- json
- ocr
- opencv
- pyqt5
- python
- raspberry-pi
- tesseract
Log in or sign up for Devpost to join the conversation.