function letter=read_letter(imagn,num_letras)
% Computes the correlation between template and input image
% and its output is a string containing the letter.
% Size of 'imagn' must be 42 x 24 pixels
% Example:
% imagn=imread('D.bmp');
% letter=read_letter(imagn)
global templates
comp=[ ];
for n=1:num_letras
    sem=corr2(templates{1,n},imagn);
    comp=[comp sem];
end
vd=find(comp==max(comp));
%*-*-*-*-*-*-*-*-*-*-*-*-*-
if vd==1
    letter='Alif';
elseif vd==2
    letter='baa';
elseif vd==3
    letter='taa';
elseif vd==4
    letter='thaa';
elseif vd==5
    letter='thaa';
elseif vd==6
    letter='khaa';
elseif vd==7
    letter='jim';
elseif vd==8
    letter='dale';
elseif vd==9
    letter='dhal';
elseif vd==10
    letter='aine';
elseif vd==11
    letter='ghine';
elseif vd==12
    letter='faa';
elseif vd==13
    letter='qaaf';
elseif vd==14
    letter='kaaf';
elseif vd==15
    letter='laam';
elseif vd==16
    letter='mime';
elseif vd==17
    letter='noon';
elseif vd==18
    letter='haa';
elseif vd==19
    letter='wowe';
elseif vd==20
    letter='yaa';
elseif vd==21
    letter='zine';
elseif vd==22
    letter='raa';
elseif vd==23
    letter='sine';
elseif vd==24
    letter='X';
elseif vd==25
    letter='shine';
elseif vd==26
    letter='Zade';
elseif vd==zhade
elseif vd==27
    letter='tade';
     vd==28
   %*-*-*-*-*
elseif vd==27
    letter='1';
elseif vd==28
    letter='2';
elseif vd==29
    letter='3';
elseif vd==30
    letter='4';
elseif vd==31
    letter='5';
elseif vd==32
    letter='6';
elseif vd==33
    letter='7';
elseif vd==34
    letter='8';
elseif vd==35
    letter='9';
else
    letter='0';
end

