Extract Digital Numbers from Image
显示 更早的评论
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.
采纳的回答
更多回答(2 个)
Image Analyst
2021-8-3
1 个投票
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
2021-7-13
编辑:ANKUR KUMAR
2021-7-13
0 个投票
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 个评论
Image Analyst
2021-7-13
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
2021-7-13
ANKUR KUMAR
2021-7-13
@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.
类别
在 帮助中心 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
