text string from image matrix
2 ビュー (過去 30 日間)
古いコメントを表示
Suppose the matrix is as in the attached figure, given by the binary matrix H or P etc. Then what is the syntax for getting the digitized string 'H' or 'P', i.e. for a hypothetical function matrix2string,
str{1}=matrix2string(H)
str{2}=matrix2string(P)
how to get the digitized string H and P, which can be used in the arguments of the 'text' or the 'uicontrol' statement. This string will get plotted on the figure at the position specified in the arguments of the 'text' or the 'uicontrol'.
H is the 7x7 matrix in this example. str is the text string (str{1}=H in this case). Using the following
uicontrol('Position',[x1 y1 x2 y2],'String',str{1})
can we get the letter H to appear at the 'Position' specified ? Thanks.
0 件のコメント
採用された回答
Cris LaPierre
2020 年 11 月 12 日
h = [0 1 0 0 0 1 0
0 1 0 0 0 1 0
0 1 0 0 0 1 0
0 1 1 1 1 1 0
0 1 0 0 0 1 0
0 1 0 0 0 1 0
0 1 0 0 0 1 0];
imagesc(h)
L = ocr(h,'TextLayout','character');
L.Text
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!