OCR Text Recognition from Image Help
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nikolaos Farmakidis
le 4 Mai 2018
Commenté : Nikolaos Farmakidis
le 16 Mai 2018
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 commentaires
Réponse acceptée
Alok Nimrani
le 16 Mai 2018
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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Language Support dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!