www.pudn.com > spectral-matching-algorithms.rar > scm_test.m, change:2014-09-09,size:870b


%-------------------------------------------------------------------------- 
%---  选取不同平衡温度不同材料弹头光谱之一为参考光谱,其余为测试光谱 ---- 
%------------------- 进行光谱相关系数匹配识别,识别规则  ------------- 
clc 
clear 
load test_spec 
sa=zeros(1,19); 
t1=zeros(5,1001); 
t2=zeros(5,1001); 
t3=zeros(5,1001); 
t4=zeros(5,1001); 
%取得测试光谱 
for i=1:5 
    t1(i,:)=spec{1,i};%4类,5个不同温度 
    t2(i,:)=spec{2,i}; 
    t3(i,:)=spec{3,i}; 
    t4(i,:)=spec{4,i}; 
end 
r=t1(1,:);%选择第一类270k目标光谱为参考光谱,其余进行测试 
r=r'; 
%进行光谱角匹配测试,为同一类光谱 
t=[t1;t2;t3;t4]; 
t=t'; 
correct=0; 
wrong=0; 
a=0.03;%阈值 
for k=2:5 
    sa(1,k-1)=SCM(t(:,k),r); 
   if sa(1,k-1)<a 
    correct=correct+1; 
   end 
end  
 for k=6:20 
    sa(1,k-1)=SCM(t(:,k),r); 
   if sa(1,k-1)<a 
    wrong=wrong+1; 
   end 
end 
plot(sa); 
correct 
wrong 

2018无需申请注册送58体验金