-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreadn.m
executable file
·86 lines (85 loc) · 1.25 KB
/
readn.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
function letter=readn(imgin)
global dbn
corr=[];
for n=1:33
s=corr2(dbn{1,n},imgin);
corr=[corr s];
end
rg=find(corr==max(abs(corr)));
letter='';
if rg==1
letter='A';
elseif rg==2
letter='B';
elseif rg==3
letter='C';
elseif rg==4
letter='D';
elseif rg==5
letter='E';
elseif rg==6
letter='F';
elseif rg==7
letter='G';
elseif rg==8
letter='H';
elseif rg==9
letter='J';
elseif rg==10
letter='K';
elseif rg==11
letter='L';
elseif rg==12
letter='M';
elseif rg==13
letter='N';
elseif rg==14
letter='P';
elseif rg==15
letter='Q';
elseif rg==16
letter='R';
elseif rg==17
letter='S';
elseif rg==18
letter='T';
elseif rg==19
letter='U';
elseif rg==20
letter='V';
elseif rg==21
letter='W';
elseif rg==22
letter='X';
elseif rg==23
letter='Y';
elseif rg==24
letter='Z';
elseif rg==25
letter='1';
elseif rg==26
letter='2';
elseif rg==27
letter='3';
elseif rg==28
letter='5';
elseif rg==29
letter='6';
elseif rg==30
letter='7';
elseif rg==31
letter='8';
elseif rg==32
letter='9';
elseif rg==33
letter='0';
elseif rg==34
letter='-';
end
if ((rg==24)+(rg==26)==1)
if sum(imgin(1,:))>50
letter='z';
else
letter='2';
end
end