How to run Libor Masek code(creat​eiristempl​ate)?

1 次查看(过去 30 天)
% createiristemplate - generates a biometric template from an iris in % an eye image. % % Usage: % [template, mask] = createiristemplate(eyeimage_filename) % % Arguments: % eyeimage_filename - the file name of the eye image % % Output: % template - the binary iris biometric template % mask - the binary iris noise mask % % Author: % Libor Masek % masekl01@csse.uwa.edu.au % School of Computer Science & Software Engineering % The University of Western Australia % November 2003
function [template, mask] = createiristemplate(eyeimage_filename)
% path for writing diagnostic images global DIAGPATH DIAGPATH = 'diagnostics';
%normalisation parameters radial_res = 20; angular_res = 240; % with these settings a 9600 bit iris template is % created
%feature encoding parameters nscales=1; minWaveLength=18; mult=1; % not applicable if using nscales = 1 sigmaOnf=0.5;
eyeimage = imread(eyeimage_filename);
savefile = [eyeimage_filename,'-houghpara.mat']; [stat,mess]=fileattrib(savefile);
if stat == 1 % if this file has been processed before % then load the circle parameters and % noise information for that file. load(savefile);
else
% if this file has not been processed before
% then perform automatic segmentation and
% save the results to a file
[circleiris circlepupil imagewithnoise] = segmentiris(eyeimage);
save(savefile,'circleiris','circlepupil','imagewithnoise');
end
% WRITE NOISE IMAGE %
imagewithnoise2 = uint8(imagewithnoise); imagewithcircles = uint8(eyeimage);
%get pixel coords for circle around iris [x,y] = circlecoords([circleiris(2),circleiris(1)],circleiris(3),size(eyeimage)); ind2 = sub2ind(size(eyeimage),double(y),double(x));
%get pixel coords for circle around pupil [xp,yp] = circlecoords([circlepupil(2),circlepupil(1)],circlepupil(3),size(eyeimage)); ind1 = sub2ind(size(eyeimage),double(yp),double(xp));
% Write noise regions imagewithnoise2(ind2) = 255; imagewithnoise2(ind1) = 255; % Write circles overlayed imagewithcircles(ind2) = 255; imagewithcircles(ind1) = 255; w = cd; cd(DIAGPATH); imwrite(imagewithnoise2,[eyeimage_filename,'-noise.jpg'],'jpg'); imwrite(imagewithcircles,[eyeimage_filename,'-segmented.jpg'],'jpg'); cd(w);
% perform normalisation
[polar_array noise_array] = normaliseiris(imagewithnoise, circleiris(2),... circleiris(1), circleiris(3), circlepupil(2), circlepupil(1), circlepupil(3),eyeimage_filename, radial_res, angular_res);
% WRITE NORMALISED PATTERN, AND NOISE PATTERN w = cd; cd(DIAGPATH); imwrite(polar_array,[eyeimage_filename,'-polar.jpg'],'jpg'); imwrite(noise_array,[eyeimage_filename,'-polarnoise.jpg'],'jpg'); cd(w);
% perform feature encoding [template mask] = encode(polar_array, noise_array, nscales, minWaveLength, mult, sigmaOnf);

回答(2 个)

Sadia sultana turna
Sadia sultana turna 2013-11-26
编辑:Sadia sultana turna 2013-11-26
i don't have clear idea about the parameters. i am still looking for proper explanation.
but if u are concerned about running 'createiristemplate' , make sure u have some other function files and the image to be processed in the same matlab directory.
other files i had in my directory were:
addcircle adjgamma canny circlecords createiristemplate encode findcircle findline gaborconvolve gethammingdistance houghcircle hysthresh linecords nonmaxup normaliseiris segmentiris shiftbits
presence of all these eased processing of a '.bmp' format image and creating an iris template. why is that, well i am working on that. let me know if u get to know about explanation of stages of 'createiristemplate' ... :)
  2 个评论
Umme Tania
Umme Tania 2013-11-27
eyeimage=imread('aeval1.bmp');
>> [template, mask] = createiristemplate('aeval1.bmp');
??? Undefined function or method 'conv2' for input arguments of type 'double' and attributes 'full 3d real'.
Error in ==> filter2 at 73 y = conv2(hcol, hrow, x, shape);
Error in ==> canny at 40 im = filter2(gaussian,im); % Smoothed image.
Error in ==> findcircle at 43 [I2 or] = canny(image, sigma, scaling, vert, horz);
Error in ==> segmentiris at 50 [row, col, r] = findcircle(eyeimage, lirisradius, uirisradius, scaling, 2, 0.20, 0.19, 1.00, 0.00);
Error in ==> createiristemplate at 56 [circleiris circlepupil imagewithnoise] = segmentiris(eyeimage);
Ammar Malik
Ammar Malik 2013-11-29
Umme Tania I was also having the same problem but found out that actually the image I was using was not a 2D image. So, first you have to convert your image to grayscale 2D image using rgb2gray command. After this your problem will be solved insha-ALLAH :)

请先登录,再进行评论。


Ammar Malik
Ammar Malik 2013-11-29
Umme Tania I was also having the same problem but found out that actually the image I was using was not a 2D image. So, first you have to convert your image to grayscale 2D image using rgb2gray command. After this your problem will be solved insha-ALLAH :)
  2 个评论
Umme Tania
Umme Tania 2013-12-2
Hey still having problem..... ??? Error using ==> iptcheckinput Function IMRESIZE expected its first input, A, to be nonempty.
Error in ==> imresize>parsePreMethodArgs at 358 iptcheckinput(A, {'numeric', 'logical'}, {'nonsparse', 'nonempty'}, mfilename, 'A', 1);
Error in ==> imresize>parseInputs at 263 [params.A, params.map, params.scale, params.output_size] = ...
Error in ==> imresize at 140 params = parseInputs(varargin{:});
Error in ==> canny at 42 im = imresize(im, scaling);
Error in ==> findline at 23 [I2 or] = canny(image, 2, 1, 0.00, 1.00);
Error in ==> segmentiris at 106 lines = findline(topeyelid);
Error in ==> createiristemplate at 57 [circleiris circlepupil imagewithnoise] = segmentiris(eyeimage);
monee
monee 2018-11-30
umm tania i have the same problem can u help me??plz

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by