This is going to be the final blog for Sci-Pi Design Challenge. In this blog I will not show any new work rather I will give a quick summary of my previous blogs. Without this I published total 9 blogs on my work. My target was to read a digital display from any device like multimeter, blood pressure meter, weight scale and upload those data to cloud. Because those devices have no option to directly interface with any microcontroller unit and so only way is to take image using camera, extract text from the camera, process it and finally use the value to any other IoT devices. I have successfully completed all the task and demonstrated my whole process step by step in my previous blogs. I used a Raspberry Pi 4 and a Raspberry Pi camera for completing my work. Thanks to Element14 and Raspberry Pi Foundation for choosing me and sending the Raspberry Pi 4.
My Previous Blogs
- Blog #1: Introduction
- Any Measurement to Pi - Blog #2: Preparing the Raspberry Pi
- Any Measurement to Pi - Blog #3: Working with Raspberry Pi Camera
- Any Measurement to Pi - Blog #4: Preparing Raspberry Pi for Image Recognition & OCR
- Any Measurement to Pi - Blog #5: Finding Best ORC Technique
- Any Measurement to Pi - Blog #6: Finding Best ORC Technique for Raspberry Pi (Part 2)
- Any Measurement to Pi - Blog #7: Direct OCR from Raspberry Pi Camera Image/Video
- Any Measurement to Pi - Blog #8: Direct OCR from Raspberry Pi Camera Image/Video (Part 2)
- Any Measurement to Pi - Blog #9: Sending OCR data to Cloud & Visualize in Dashboard using Node-RED
In my first blog I tried to the my idea about my project. I also explained what problem I faced before when I tried to interface a blood pressure meter with my IoT project. From that problem I came to this idea of indirectly interfacing a digital device to a microcontroller or microprocessor based project.
In my second blog I prepared my Raspberry Pi 4 device for my work. I collected a power supply, SD card, Raspberry Pi Camera and downloaded other software tools like PuTTY and WinSCP for making the journey easy. I also showed how i installed the latest OS to my Pi.
My third blog was about the camera module of raspberry pi. I showed in that blog how we can set up a raspberry pi camera module, how to capture image from the camera module using terminal command as well as programmatically using Python. I also discussed about the camera modules available for raspberry pi that we can use for our project.
In my fourth blog I find the idea of OCR for extracting text from the display. I explain about OCR in brief and mentioned the available OCR tools. I showed how I installed the OCR to in my raspberry pi. OCR tools also requires some other auxiliary tools. Those tools were also installed in that blog. Finally I installed the OpenCV image processing tools to my pi.
I get started working with OCR tools in my fifth blog. In that blog I briefly illustrate the required preprocessing steps involved for good OCR result. I tried to explain every steps with sample input and output images. Then I did OCR practically on some multimeter images on my raspberry pi. I used Python and Jupyter notebook for running code and showing the result. I illustrated all the result I got from the OCR in a table and give a comparison.
After getting unsatisfying result from tesseract ocr which I tested in blog five I find out another ocr tool for senven segment type display font and demonstrated that in my sixth blog. I installed that tool and experiment the tool with some of my previous sample multimeter images. I got better result compared with the previous result. I demonstrated all the result in a table for better understanding. I came to a decision about which ocr tool I should use in what situation.
In my seventh blog I demonstrated how the full OCR process from taking image from raspberry pi camera to final output can be performed by a single Python program. I explained the full program step by step with representing the output of each step and finally attached the full program at the end of the blog.
My eighth blog was a continuation of the seventh blog. In my eighth blog I presented my hardware setup for performing the image capturing easily. I illustrated the schematic diagram and made a box for my project. I added two tactile buttons and connected with raspberry pi in this blog. I showed how I am taking image from a multimeter display with the help of the box I made. I explain about adding a led light with the camera for edge of the image capturing. I also added a flow chart for the program I developed for the whole process from image capturing to final output. At the end of the blog post I attached a short demo video that shows how it takes an image of multimeter display on a button press and show the display value in the terminal.
In my ninth blog I used mqtt to publish the ocr result to the cloud server. And finally showed how to present the result in a graphical dashboard. I demonstrated the full process step by step from installing the required tools to the dashboard making.
What I have Learned
I spent many hours for the contest and I have learned a lot from this Sci-Pi Design Contest. I worked with Raspberry Pi several times before but never worked with image processing and OCR. As far I remember I tried to install OpenCV few years back to my Raspberry Pi 2 but I failed to do that. This time though I face some difficulties on installing OpenCV on my Raspberry Pi 4 but after a few trials I successfully installed it. From this contest I also learned about OCR different OCR tools like tesseract, pytesseract, ssocr and different pre-trained model of tesseract that works with different custom fonts. I realized that OCR is a nice tool to work with but no OCR is 100% accurate. Noise and color imbalance affects the OCR result seriously. A preprocessing of the image can improve the result dramatically. Choosing the right OCR tool is also important.
I did some image processing before but I never deep drive on it. For this contest I learned some new and interesting image preprocessing techniques. Specially I learned about contour and contour detection using OpenCV. Cropping only the display portion from a multimeter image using contour detection technique was really fascinated me. I got a huge motivation for working with image processing and Raspberry Pi in coming days.
Though I did not explain how to train tesseract ocr engine using custom fonts or languages in my blog post I learnt the topic. In future this learning will help me to bring out the perfect result from tesseract for custom use case.
A big Thanks to...
First I would like to thanks Element14 and Raspberry Pi for organizing such an excellent contest. Special thanks to both of them for selecting me as a sponsored challenger and sending me the cool 4GB Raspberry Pi 4. Thanks to Element14 community members for reading my blogs and inspiring me by providing valuable suggestions and feedback. I received a huge number of comments, suggestions feedback and messages from the community members for my blog posts which was beyond my expectation. Definitely a good comment and feedback always motivates us for future works. Special thanks to DAB, ggabe, dougw, soldering.on and mitchind for their important suggestions and feedback. Thanks to all my readers.