字符的归一化互相关

时间:2017-03-04 18:43:48

标签: templates character matching

这是模板匹配相关部分

function letter=read_letter(img_r,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=[ ];
%while 1
for n=1:length(templates)
sem=corr2(templates{1,n},img_r); 
comp=[comp sem];  
end
vd=find(comp==max(comp));
if vd==1
letter='A';
elseif vd==2
letter='B';
........
else
letter='z';
end

模板匹配可以是各种类型。我的模板是否基于互相关匹配? 我想知道如何使用规范化互相关来识别字符

plz help

感谢

1 个答案:

答案 0 :(得分:0)

corr2已经计算了归一化相关性。 比较归一化互相关的definition和matlab implementation