i am new to matlab that the error is coming like that Error using segmentiris (line 18) Not enough input arguments.please send me answers how to fix the error

1 visualización (últimos 30 días)
tic radial_res=150; angular_res=900; for i=1; for j=1; eyeimage_filename= [num2str(2) '\' num2str(i) '\' num2str(j) '.jpg']; eyeimage1 =imread(eyeimage_filename); savefile=[num2str(2)'\' num2str(i)'\' num2str(j)'-houghpara.m']; [circleiris circlepupil segimage] = segmentiris(eyeimage1); save('savefile','circleiris','circlepupil','segimage');
%write noise image
segimage2=uint8(segimage);
imagewithcircles=uint8(eyeimage1);
%get pixel coords for circle around iris
[x,y] = circlecoords([circleiris(2),circleiris(1)],circleiris(3),size(eyeimage1));
ind1=sub2ind(size(eyeimage1),double(y),double(x));
%get pixel coords for circle around pupil
[xp,yp] = circlecoords([circlepupil(2),circlepupil(1)],circlepupil(3),size(eyeimage1));
ind2=sub2ind(size(eyeimage1),double(yp),double(xp));
%write circles overlayed
imagewithcircles(ind2)=255;
imagewithcircles(ind1)=255;
imwrite(imagewithcircles,[num2str(2)'\' num2str(i)'\' num2str(j) '-segmented.jpg'],'jpg');
figure(1)
imshow(imagewithcircles,[])
pause
%perform normalisation
[polar_array] = normaliseiris(segimage, circleiris(2),...
circleiris(1), circleiris(3), circlepupil(2), circlepupil(1), circlepupil(3),eyeimage1, radial_res, angular_res);
%write normalised pattern and noise pattern
imwrite(polar_array,[num2str(2) '\' num2str(i)'\' num2str(j)'-polar.jpg'],'jpg'); figure(2) imshow(polar-array,[]) pause h=imcrop(polar_array,[2.91935483870968 897.58064516129 90.3225806451613]); imwrite(h,[num2str(2) '\' num2str(i)'\' num2str(j)'-cropimage.jpg'],'jpg'); figure(3) imshow(h,[]) pause polar=histeq(h); f=fspecial('gaussian'); polar=imfilter(polar,f);
imwrite(polar,[num2str(2) '\' num2str(i)'\' num2str(j)'-finalimage.jpg'],'jpg');
figure(4)
imshow(polar,[])
pause
end
end
toc
d=toc
function [circleiris, circlepupil, segimage]= segmentiris(eyeimage)
%define range of pupil & iris radii
%ubiris
lpupilradius = 5;
upupilradius = 20;
lirisradius = 30;
uirisradius = 60;
% define scaling factor to speed up Hough transform scaling = 0.4;
reflecthres = 240;
% find the iris boundary [row, col, r] = findcircle(eyeimage, 30,60, 0.4, 2, 0.31, 0.30, 1.00, 1.00);
circleiris = [row col r];
rowd = double(row); cold = double(col); rd = double(r);
irl = round(rowd-rd); iru = round(rowd+rd); icl = round(cold-rd); icu = round(cold+rd);
imgsize = size(eyeimage);
if irl < 1 irl = 1; end
if icl < 1 icl = 1; end
if iru > imgsize(1) iru = imgsize(1); end
if icu > imgsize(2) icu = imgsize(2); end
% to find the inner pupil, use just the region within the previously % detected iris boundary imagepupil = eyeimage( irl:iru,icl:icu);
%find pupil boundary [rowp, colp, r] = findcircle(imagepupil, 5,20 ,0.6,2,0.25,0.25,1.00,1.00);
rowp = double(rowp); colp = double(colp); r = double(r);
row = double(irl) + rowp; col = double(icl) + colp;
row = round(row); col = round(col);
circlepupil = [row col r];
% set up array for recording noise regions % noise pixels will have NaN values % imagewithnoise = double(eyeimage);
%find top eyelid topeyelid = imagepupil(1:(rowp-r),:); lines = findline(topeyelid);
if size(lines,1) > 0 [xl yl] = linecoords(lines, size(topeyelid)); yl = double(yl) + irl-1; xl = double(xl) + icl-1;
yla = max(yl);
y2 = 1:yla;
% ind3 = sub2ind(size(eyeimage),yl,xl); % imagewithnoise(ind3) = NaN;
% imagewithnoise(y2, xl) = NaN; end
%find bottom eyelid bottomeyelid = imagepupil((rowp+r):size(imagepupil,1),:); lines = findline(bottomeyelid);
if size(lines,1) > 0
[xl yl] = linecoords(lines, size(bottomeyelid));
yl = double(yl)+ irl+rowp+r-2;
xl = double(xl) + icl-1;
yla = min(yl);
y2 = yla:size(eyeimage,1);
% ind4 = sub2ind(size(eyeimage),yl,xl); % imagewithnoise(ind4) = NaN; % imagewithnoise(y2, xl) = NaN; % end
% %For CASIA, eliminate eyelashes by thresholding % ref = eyeimage < 100; % coords = find(ref==1); % imagewithnoise(coords) = NaN;

Respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by