Display nth character in a Binary image

1 回表示 (過去 30 日間)
RandomChikiBum
RandomChikiBum 2022 年 10 月 11 日
コメント済み: Walter Roberson 2022 年 10 月 12 日
I have a binary image consisting of characters (alphanumeric), I can find the total number of characters in the Image but How do I find the nth charecter
I have also attatched the image, how do i find out the 5th character in the image?

採用された回答

Walter Roberson
Walter Roberson 2022 年 10 月 11 日
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1152713/AlphanumericBinaryImage%20copy.png';
I = imread(filename);
t = ocr(I)
t =
ocrText with properties: Text: 'GJ03ER0563↵↵' CharacterBoundingBoxes: [12×4 double] CharacterConfidences: [12×1 single] Words: {'GJ03ER0563'} WordBoundingBoxes: [95 59 442 70] WordConfidences: 0.8790
n = 5
n = 5
t.Words{1}(n)
ans = 'E'
This would need a slight bit more work if there were multiple words and you wanted to know the n'th character wrapping through the words (for example, the 15th character from the beginning.) One of the questions would be whether the break between words should count as a letter for this purpose -- are you effectively transcribing the text (which would expect a space between words) ?
  2 件のコメント
RandomChikiBum
RandomChikiBum 2022 年 10 月 12 日
編集済み: RandomChikiBum 2022 年 10 月 12 日
For this task each characters are separated by a space and the task is completed, I wonder how characters in a sentence where words are separated by spaces are detected?
Walter Roberson
Walter Roberson 2022 年 10 月 12 日
The Words property would be a cell array of character vectors.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by