OCR Text Recognition from Image Help

조회 수: 3 (최근 30일)
Nikolaos Farmakidis
Nikolaos Farmakidis 2018년 5월 4일
댓글: Nikolaos Farmakidis 2018년 5월 16일
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

채택된 답변

Alok Nimrani
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.
  댓글 수: 1
Nikolaos Farmakidis
Nikolaos Farmakidis 2018년 5월 16일
Hi Alok, Many thanks for your answer. Unfortuntely I didn't have much luck with image editing, filtering and sharpenign but your second suggestion really helps. Thanks a lot Nick

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by