samfun.m
来自「matlab平台上的图像处理源代码」· M 代码 · 共 26 行
M
26 行
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% generate the sample pattern for the fingerprint identification
% written by zhang_rui at Chinese Academy of Science
% E-mail:zhangrui05@mails.gucas.ac.cn
% 2006/6/2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%r=radius of smallest circle R=radius of the biggest circls
%n=number of the circle N1=first circle's sample N1 times
function S=samfun(r,R,n,N1)
S=zeros(2*R+1,2*R+1);
width=(R-r)/n;
for i=1:n
if(i==1)
r=r;
else
r=r+width;
end
for j=1:N1*i
sita=2*pi*(j-1)/(N1*i);
for k=1:width
S(R-fix((r+k-1)*sin(sita)),R+fix((r+k-1)*cos(sita)))=255;
%imshow(S);
end
end
end
%imshow(S,[]);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?