Extract Digital Numbers from Image
Mostra commenti meno recenti
Hi All.
I have lots of scale images that I would like to extract the scale reading from. I have looked through many sources such as "ocr" but when applying that it doesn't read the numbers shown. Attached is an image after processing (cropping. brightining..etc). I appreciate if someone can help me find a way to extract the numbers out of the image.
Risposta accettata
Più risposte (2)
Image Analyst
il 3 Ago 2021
1 voto
I tried it with my new computer and developed a solution for seven segment LED displays that uses masking to examine the 7 locations where a segment would be. From the pattern or lit or non-lit, I can turn that into a number. It works, as in the attached demo.
I got word from a developer on the Computer Vision team that the ocr() function was not trained for seven segment characters. Still it's surprising how bad it is for certain numbers like thinking a 2 was an 8 and the 8 was a 9.

ANKUR KUMAR
il 13 Lug 2021
Modificato: ANKUR KUMAR
il 13 Lug 2021
0 voti
You can simply use ocr command to do that. Refer to this documentation for some example, which would be a good starting point for you to take it forward.
3 Commenti
Image Analyst
il 13 Lug 2021
Yep, I looked at that in my Answer. And I presume @Abdullah Azzam did too. Did you run my code or try the ocr function? So why is it saying the 2 is an 8?
Abdullah Azzam
il 13 Lug 2021
ANKUR KUMAR
il 13 Lug 2021
@Image Analyst OCR behaves wierd. I just tune the masking factor, and getting 137.313.
mask = conv2(double(mask), ones(windowSize)/windowSize^2, 'full') > 0.3;
I replaced 0.5 to 0.3. I played around masking thresholds and all, but not getting the exact value.
Categorie
Scopri di più su Convert Image Type in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
