Count the number of characters in an image

6 ビュー (過去 30 日間)
sindhu c
sindhu c 2015 年 11 月 25 日
コメント済み: sindhu c 2015 年 11 月 26 日
I want to count the number of letters present in the image..How to code it? I just want to count,not recognizing by ocr... Please help me with the code. Thank you

回答 (2 件)

Walter Roberson
Walter Roberson 2015 年 11 月 25 日
If you do not use OCR then you cannot determine where the boundaries are between letters. For example on the 6th line near the end, the spacing is enough between the left stroke of the 'H' and the right-stroke together with horizontal bar, that without ocr one would tend to count that as two different letters. Then by using average width one might perhaps break apart the horizontal bar and right vertical stroke of the 'H' from the following 'e', but if you do so then you would have arrived at 3 characters, the left stroke of the H, the horizontal and right stroke of the H, and the 'e'. It requires OCR to recognize that the horizontal and right stroke does not form a character and that you need to "back up" to the left stroke to piece together an 'H'.
Therefore the task cannot be done accurately without using OCR.
  3 件のコメント
sindhu c
sindhu c 2015 年 11 月 26 日
Ok thank you sir..will try

サインインしてコメントする。


Image Analyst
Image Analyst 2015 年 11 月 25 日
I think Walter's idea of identifying connected components and then binning the width to determine if the blob is 1, 2, 3 or whatever characters long is worth trying. I was going to suggest a similar thing based on the area. Either way, you'll have a problem in that some letters, like an i, are narrower and have less area than others, say a w.

カテゴリ

Help Center および File ExchangeLanguage Support についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by