text string from image matrix
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 12 Nov. 2020
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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Environment and Settings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!