Best OCR for a funny project - Suggestions?

hatzisn

Expert
Licensed User
Longtime User
Good evening everyone,

today I had an idea on a funny project that would be perfect when I do my laundry. When I set the washing machine at a specific program it starts counting the time with a reverse timer and at the end it displays "End". I thought it would be easy to use my ESP32CAM to take a picture of the display on demand and send it to a webapp in Raspberry Pi which would perform OCR to get the remaining time and when "End" was displayed (in a 7-segments display) it would post an MQTT message in home assistant which would create an app notification and I would get it in my watch to go and get the clothes. I thought of using tesseract and created a docker image with it, in which I attached a terminal to try it. The results for it are disappointing completely. I get no result.

Although it is able to process text in a white background in multiple languages correctly, it cannot do the same for text in different colors and different background colors. You can see bellow the image of the display. Is there a way to get tesseract to recognize it? If not, is there another freeware OCR that can do this?

1735405178820.png
 

Pendrush

Well-Known Member
Licensed User
Longtime User
Last edited:

LucaMs

Expert
Licensed User
Longtime User
I can't help you, also because I don't even know what Tesseract is (obviously I could find out) but I must to tell you this.

In an episode of "Two men and a half", the protagonist, rich, alcoholic, etc., decides to do everything himself, he thinks that doing the laundry is easy. He starts, making mistakes (mixing colored clothes), which his brother corrects. Then he asks his brother:

"But how do you know when it's finished?"

"The washing machine warns you, it sends you an SMS"

"Wow, how far has technology come"
 

LucaMs

Expert
Licensed User
Longtime User
I can't help you, also because I don't even know what Tesseract is (obviously I could find out) but I must to tell you this.

In an episode of "Two men and a half", the protagonist, rich, alcoholic, etc., decides to do everything himself, he thinks that doing the laundry is easy. He starts, making mistakes (mixing colored clothes), which his brother corrects. Then he asks his brother:

"But how do you know when it's finished?"

"The washing machine warns you, it sends you an SMS"

"Wow, how far has technology come"
 

melonZgz

Active Member
Licensed User
Longtime User
Some time ago I did some OCR projects using Python. I used OpenCV for all the image processing. After that I also used tesseract for some of them, and also did my own OCR using the Knn algorithm, wich is a lot faster and in a case like yours it could work (but you have to train it before... if it's the first time you use this stuff it may be complicated)
I started here as a reference, as there are a lot of tutorials and usefull information:
https://pyimagesearch.com/2018/07/19/opencv-tutorial-a-guide-to-learn-opencv/
 

hatzisn

Expert
Licensed User
Longtime User
I can't help you, also because I don't even know what Tesseract is (obviously I could find out) but I must to tell you this.

In an episode of "Two men and a half", the protagonist, rich, alcoholic, etc., decides to do everything himself, he thinks that doing the laundry is easy. He starts, making mistakes (mixing colored clothes), which his brother corrects. Then he asks his brother:

"But how do you know when it's finished?"

"The washing machine warns you, it sends you an SMS"

"Wow, how far has technology come"

1) Tesseract is a multiplatform package that you install to perform local OCR.
2) I have already learned from my mistakes in clothes mixing. So did the clothes 😅
3) My washing machine does not send an SMS. It just calls me and asks me politely to go to it and pick up the clothes 🤣🤣🤣🤣
 
Last edited:

hatzisn

Expert
Licensed User
Longtime User
I remembered wrong, the washing machine will not send an SMS, it will call directly 😂

Next time I must read the thread until the end.
 

hatzisn

Expert
Licensed User
Longtime User

Only for 7 segment numbers. Get file: letsgodigital.traineddata and use it with Tesseract.
You also need to prepare image for Tesseract, I don't think that you will have any success with image from your post.

Thank you. I did try it and it did not work either. It spends some time like it is recognizing something and just returns to the linux prompt.
 

hatzisn

Expert
Licensed User
Longtime User
I have got that correctly with this:


in order to make it work in debian based linux distros or docker images you must do the following:
Bash:
sudo apt install libimlib2 libimlib2-dev

#Then cd into the folder where you have saved the decompressed code
make install

#The command that worked for me was
ssocr -d -1 make_mono invert closing 2 {imagename}

Also you may want to have a look at this:

 
Last edited:
Top