資源簡介
一套關于指紋識別的,我帶的本科生畢業設計,現在發上來給大家共享,有這方面研究的絕對是好材料。程序中有指紋圖像的歸一化,圖像分割,圖像增強,方向圖,細化,特征提取,偽特征去除,特征匹配等等。

代碼片段和文件信息
clc
clear?all
close?all
originI=imread(‘qwe.bmp‘);
[mns]?=?size(originI);
I=originI;
if?s?==?3
????I?=?rgb2gray(originI);
end
I=double(I);
figure?imshow(uint8(I))?
tic
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?歸一化
M=0;var=0;
for?x=1:m
????for?y=1:n
????????M=M+I(xy);
????end
end
M1=M/(m*n);
for?x=1:m
????for?y=1:n
????????var=var+(I(xy)-M1)*(I(xy)-M1);
????end
end
var1=var/(m*n);
%c=sqrt(30*(I(xy)-M1)/var1);
for?x=1:m
????for?y=1:n
????????if?I(xy)>=M1
????????????I(xy)=150+sqrt(2000*(I(xy)-M1)/var1);
????????else
????????????I(xy)=150-sqrt(2000*(M1-I(xy))/var1);
????????end
????end
end
%figure?imshow(uint8(I))?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?分割
M?=?10;??????%1
H?=?m/M;??L=?n/M;
aveg1=zeros(HL);
var1=zeros(HL);
for?x=1:H;
???for?y=1:L;
???????aveg=0;var=0;
????????for?i=1:M;
????????????for?j=1:M;
????????????????aveg=I(i+(x-1)*Mj+(y-1)*M)+aveg;
????????????end
????????end
?????????aveg1(xy)=aveg/(M*M);
????????for?i=1:M;
????????????for?j=1:M;
????????????????var=(I(i+(x-1)*Mj+(y-1)*M)-aveg1(xy))*(I(i+(x-1)*Mj+(y-1)*M)-aveg1(xy))+var;
????????????end
????????end
????????
????????var1(xy)=var/(M*M);
????????
???end
end
Gmean=0;Vmean=0;
for?x=1:H
????for?y=1:L
????????Gmean=Gmean+aveg1(xy);
????????Vmean=Vmean+var1(xy);
????end
end
Gmean1=Gmean/(H*L);
Vmean1=Vmean/(H*L);
gtemp=0;gtotle=0;vtotle=0;vtemp=0;
for?x=1:H
????for?y=1:L
???????if?Gmean1>aveg1(xy)
???????????gtemp=gtemp+1;
???????????gtotle=gtotle+aveg1(xy);
???????end
???????if?Vmean1 ???????????vtemp=vtemp+1;
???????????vtotle=vtotle+var1(xy);
???????end?
????end
end
G1=gtotle/gtemp;V1=vtotle/vtemp;
gtemp1=0;gtotle1=0;vtotle1=0;vtemp1=0;
for?x=1:H
????for?y=1:L
???????if?G1 ???????????gtemp1=gtemp1+1;
???????????gtotle1=gtotle1+aveg1(xy);
???????end
???????if?0 ???????????vtemp1=vtemp1+1;
???????????vtotle1=vtotle1+var1(xy);
???????end?
????end
end
G2=gtotle1/gtemp1;V2=vtotle1/vtemp1;
moban=zeros(HL);
T1=G2;T2=V2;
T3=G1-100;T4=V2-10;
for?x=1:H
???for?y=1:L
???????if?aveg1(xy)>T1?&&?var1(xy) ???????????moban(xy)=1;
???????end
???????if?aveg1(xy) ???????????moban(xy)=1;
???????end
???end
end
for?x=2:H-1
????for?y=2:L-1
????????if?moban(xy)==1
????????????if?moban(x-1y)?+?moban(x-1y+1)?+moban(xy+1)?+?moban(x+1y+1)?+?moban(x+1y)?+?moban(x+1y-1)?+?moban(xy-1)?+?moban(x-1y-1)?<=4
????????????????moban(xy)=0;
????????????end
????????end
????end
end??%2
Icc?=?ones(mn);
for?x=1:H
???for?y=1:L
???????if??moban(xy)==1
??????????
??????????for?i=1:M
????????????for?j=1:M
????????????????I(i+(x-1)*Mj+(y-1)*M)=G1;
????????????????Icc(i+(x-1)*Mj+(y-1)*M)=0;
????????????end
??????????end
?
???????end
???????
???end
end
%figure?imshow(uint8(I))?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????270054??2010-03-21?15:27??指紋識別\qwe.bmp
?????文件??????17308??2010-04-11?13:08??指紋識別\SHEJIzhiwen.m
?????目錄??????????0??2010-04-11?13:11??指紋識別
-----------?---------??----------?-----??----
???????????????287362????????????????????3
評論
共有 條評論