OCR Text Recognition from Image Help
3 次查看(过去 30 天)
显示 更早的评论
Hi all, I would really appreciate some help recognizing some text in some black and white images. This is the last part of an automated code to read scale bars from some micrographs so this is very important in my entire analysis.
Attached is the image that I have and I simply want to read in the text that says 200 nm.
I use: ocr(Image)
but the text I get is: ' 1zn.s1 K x znn nm wn 5.3 mn Merlin-60-62 ?T Cnlumn Made = Analytic ' which is close but not what I need. Any suggestions? Any input will be greatly appreciated, Best, Nick
0 个评论
采纳的回答
Alok Nimrani
2018-5-16
Hi Nikolaos,
You can use some of the image pre-processing techniques to improve the readability of the image such as:
• Resizing the image
• Converting the image to Gray scale and binarizing the image using appropriate thresholding level
• Noise removal and image sharpening
• Increasing the contrast of the image since low contrast can result in poor OCR
You can also leverage priori knowledge about the text within the image and improve the results by constraining ‘ocr’ to only select the best matches from the character set that you want to match. For example, since you want to read the text ‘200nm’, you can use a character set consisting of digits and the letters ‘n’ and ‘m’ as follows:
>> results = ocr(BW2, 'CharacterSet', '0123456789nm', 'TextLayout','Block');
>> results.Text
ans =
' m39 205 5 1 200nm 1m 0 48mn
3 m6062 1
60 nmn 0019 nn3 3n 0
'
You can then select the required text '200nm' from this result.
For more information about improving the OCR results, you can refer the following link: https://www.mathworks.com/help/vision/examples/recognize-text-using-optical-character-recognition-ocr.html
Hope this helps.
Thanks.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Language Support 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!