matlab人眼虹膜识别程序调试
Y=imread('test1.jpg');Y1=rgb2gray(Y);I=im2bw(Y1);[sy,sx]=size(I);[y,x]=find(I);totalp...
Y =imread('test1.jpg');
Y1=rgb2gray(Y);
I= im2bw(Y1);
[sy,sx]=size(I);
[y,x]=find(I);
totalpix = length(x);
HM_tmp = zeros(sy*sx,1);
b=1:sy;
a=zeros(sy,totalpix);
if nargin==1
R_min=1;
R_max=max(max(x),max(y));
else
R_min=Rp(1);
R_max=Rp(2);
end
y=repmat(y',[sy,1]);
x=repmat(x',[sy,1]);
HPN=0;
for R=R_min:R_max
R2=R^2;
b1=repmat(b',[1,totalopix]);
b2=b1;
a1=(round(x - sqrt(R2-(y-b1).^2)));
a2=(round(x + sqrt(R2-(y-b2).^2)));
b1=b1(imag(a1)==0 & a1>0 & a1<sx);
a1=a1(imag(a1)==0 & a1>0 & a1<sx);
b2=b2(imag(a2)==0 & a2>0 & a2<sx);
a2=a2(imag(a2)==0 & a2>0 & a2<sx);
ind1=sub2ind([sy,sx],b1,a1);
ind2=sub2ind([sy,sx],b2,a2);
ind=[ind1;ind2];
val=ones(length(ind),1);
data=accumarray(ind,val);
HM_tmp(1:length(data))=data;
HM2_tmp=reshape(HM_tmp,[sy,sx]);
imshow(HM2,[]);
maxval=max(max(HM2_tmp));
if maxval>HPN
HPN=maxval;
HM=HM2_tmp;
Rc=R;
end
end
[B,A]=find(HM==HPN);
C=[mean(A),mean(B),Rc];
if nargin==1这一行报错,错误使用 nargin
您只能从 MATLAB 函数中调用 nargin/nargout。
出错 Untitled (line 10)
if nargin ==1 展开
Y1=rgb2gray(Y);
I= im2bw(Y1);
[sy,sx]=size(I);
[y,x]=find(I);
totalpix = length(x);
HM_tmp = zeros(sy*sx,1);
b=1:sy;
a=zeros(sy,totalpix);
if nargin==1
R_min=1;
R_max=max(max(x),max(y));
else
R_min=Rp(1);
R_max=Rp(2);
end
y=repmat(y',[sy,1]);
x=repmat(x',[sy,1]);
HPN=0;
for R=R_min:R_max
R2=R^2;
b1=repmat(b',[1,totalopix]);
b2=b1;
a1=(round(x - sqrt(R2-(y-b1).^2)));
a2=(round(x + sqrt(R2-(y-b2).^2)));
b1=b1(imag(a1)==0 & a1>0 & a1<sx);
a1=a1(imag(a1)==0 & a1>0 & a1<sx);
b2=b2(imag(a2)==0 & a2>0 & a2<sx);
a2=a2(imag(a2)==0 & a2>0 & a2<sx);
ind1=sub2ind([sy,sx],b1,a1);
ind2=sub2ind([sy,sx],b2,a2);
ind=[ind1;ind2];
val=ones(length(ind),1);
data=accumarray(ind,val);
HM_tmp(1:length(data))=data;
HM2_tmp=reshape(HM_tmp,[sy,sx]);
imshow(HM2,[]);
maxval=max(max(HM2_tmp));
if maxval>HPN
HPN=maxval;
HM=HM2_tmp;
Rc=R;
end
end
[B,A]=find(HM==HPN);
C=[mean(A),mean(B),Rc];
if nargin==1这一行报错,错误使用 nargin
您只能从 MATLAB 函数中调用 nargin/nargout。
出错 Untitled (line 10)
if nargin ==1 展开
1个回答
展开全部
pdf函数 function a=pdf_8psk(x,y,SNR) a=1/16/pi*(exp(-((x-sqrt(SNR))).^2/2)+exp(-(x+sqrt(SNR)).^2/2)+exp(-(y-sqrt(SNR)).^2/2)+exp(-(y+sqrt(SNR)).^2/2)+exp(-(x-sqrt(SNR/2)).^2/2-(y-sqrt(SNR/2)).^2/2)... +exp(-(x+sqrt(SNR/2)).^2/2-(y-sqrt(SNR/2)).^2/2)+exp(-(x-sqrt(SNR/2)).^2/2-(y+sqrt(SNR/2)).^2/2)+exp(-(x+sqrt(SNR/2)).^2/2-(y+sqrt(SNR/2)).^2/2));
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
深圳量子动力
2024-10-28 广告
2024-10-28 广告
在量子动力(深圳)计算机科技有限公司,我们致力于将前沿技术融入安防与智能识别领域。摄像头人脸捕捉技术,依托深度学习算法与高效图像处理能力,能够在复杂环境中迅速锁定并精准捕捉人脸信息。这一技术不仅提升了监控系统的智能化水平,还在公共安全、门禁...
点击进入详情页
本回答由深圳量子动力提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询