This is a project that we made as our final college project on Video Text Extraction & Image Processing. The objective is to successfully extract text from address plates of people's houses from a drone's camera which would help in correct delivery of goods. The software implementation, i.e. the video text extraction part of the project is included here.
We basically divide the project into 2 parts:
- Extraction of individual frames from the video.
- Text extraction from the frames
- Download all the files of this repository to your computer.
- Use any code editor or IDE that supports Python.
- Create a folder(say: ABC) and inside it paste the two python files "Extract_Frames.py" and "Frame_to_text.py".
- Copy all the videos: Sample.mp4, Sample1.mp4, Sample2.mp4, Sample3.mp4 to the folder ABC that you created. You can also use your own video. Make sure to keep your video in this directory.
- Inside the folder ABC, create a directory named "data". All output will be generated and stored in this directory.
- Run the program "Extract_Frames.py" first. Be sure to change the name of the video to the appropriate name and the path where the output is to be stored appropriately. The code is properly documented and can be easily understood.
- Next run the program "Frame_to_text.py" to generate the text from the frames.
"Our outputs for the respective videos are stored in the zip files. Unzip them to see the output that was generated."
If you see an error like: "module cv2 not found", then we need to install cv2 in the system.
Generally it can be installed by running the command "pip install opencv-python" in the terminal. However it may vary from IDE to IDE. Make sure that your IDE supports Python and OpenCV.
Next we also need to have "pytesseract" installed in our system. Also make sure that all the packages used the programs are installed. The easiest and best way to obtain tesseract for Windows is here.
Click download->tesseract-ocr-w64-setup-v5.0.0-alpha.20200328.exe (for 64 bit system)
After installation, you need to set the environment variable for Tesseract OCR. For that go to "settings-> search for edit environment variables -> open environment variables-> go to user variables -> go to path -> create a new entry and set it to “Path to Tesseract OCR”
This is just the software part. For the actual project, we had even constructed a working drone. For more details about the complete project, you can read the Basic Idea & Motivation as follows:
- Reduce delivery time using drones
- Can be used for
speedy delivery of temperature & time-sensitive commodities like blood, organs
perishable goods like flowers/milk
delivery to remote areas - Fully autonomous to reduce/eliminate human control
- Feed real-time video to controlling station
Our aim is to reduce delivery time for time-sensitive, perishable goods and increase the ease of delivery in remote zones. In times of the pandemic caused by Covid-19, an autonomous drone delivery system is very useful to maintain contactless delivery and to reach red zones where humans are not allowed.
For more details about our project you can view the presentation "drone_ppt" prepared by us. This is actually our final year college project. The link to my project partner's profiles are meet2mky and ydAshwani.