Image normalization using Daugman Rubber sheet model
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
Hello everyone. i have segmenated image of iris and i need to normalize it using daugman rubber sheet model. i tried using https://www.mathworks.com/matlabcentral/fileexchange/51246-pupil-limbus-detection-and-daugman-normalization but i cannot get the output.
here's the error. can expalin how to use it?
i also put declaration like this; and dont get the output
% % Input parameters
% xPosPupil = 625;
% yPosPupil = 306;
% rPupil = 70;
% xPosIris = 625;
% yPosIris = 306;
% rIris = 250;

採用された回答
Frank Martin
2019 年 4 月 15 日
You are calling the daugmanCircleDetection function which complains that it cannot find the class ASSStack. To solve this you should make sure that Matlab can find the class (https://github.com/frankcorneliusmartin/IrisAlgorithms/blob/master/Classes/ASSStack.m) . However: The function daugmanCircleDetection is used to segment the limbus and pupil, and not for normalization.
You should call the function rubberSheetNormalisation instead to perform the normalization, which is defined in https://github.com/frankcorneliusmartin/IrisAlgorithms/blob/master/Segmentation/rubberSheetNormalisation.m
Too see how this function works see example:https://github.com/frankcorneliusmartin/IrisAlgorithms/blob/master/Examples/RubbersheetModel.m
5 件のコメント
syahira samsudin
2019 年 4 月 15 日
編集済み: syahira samsudin
2019 年 4 月 15 日
Frank Martin
2019 年 4 月 15 日
That would be a valid way to do this yes.
syahira samsudin
2019 年 4 月 16 日
this is how i insert the coding. is it correct?
function image = rubberSheetNormalisation( img, xPosPupil, yPosPupil, rPupil , xPosIris , yPosIris , rIris , varargin )
%rubberSheetNormalisation, function that normalizes the iris region. This is
%the region between the pupil boundary and the limbus. This is done
%according to the rubber sheet model proposed by Daugman (1).
%
% SYNOPSIS
% - image = rubberSheetNormalisation( img, xPosPupil, yPosPupil, rPupil , xPosIris , yPosIris , rIris )
% - image = rubberSheetNormalisation( img, xPosPupil, yPosPupil, rPupil , xPosIris , yPosIris , rIris , 'DebugMode' , 1 )
%
% INPUTS
% - img <double>
% Eye image from the cassini, preferably a NIR image. If no image
% is supplied, a pop up will ask to select one.
% - xPosPupil <integer>, yPosPupil <integer>, rPupil <integer>
% The x,y-position of the pupil center and the pupil radius
% - xPosIris <integer>, yPosIris <integer>, rIris <integer>
% The x,y-position of the iris center and the iris radius
% - varargin <optional>, input scheme
% 'DebugMode': {0: off, 1: on} - if set to 1 shows extra info
% 'AngleSamples': <integer> - number of radial samples
% 'RadiusSamples': <integer> - number of radius samples
% 'UseInterpolation': <boolean> - if 1, the samples will be
% interpolated else nearest neighbor interpolation is used.
%
% OUTPUT
% - image, containing the normalized iris region
%
% DEPENDANCIES
% - Communications Toolbox
% - Computer Vision System Toolbox (for debugmode)
%
% HISTORY
% - 26th may 2017: removed Communications Toolbox
% - 19th June 2016: added the interpolation option
%
% REFERENCES
% (1) How iris recognition works, Daugman, J.G.
%
% AUTHOR
% F.C. Martin <frank@grafikus.nl>
% 19th of May 2015 - 26th may 2017
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% Load the image
img = imread('1.jpg');
% Input parameters
xPosPupil = 1007;
yPosPupil = 947;
rPupil = 503;
xPosIris = 313;
yPosIris = 323;
rIris = 156;
% Normalize the iris region according to daugmans model
irisRegion = rubberSheetNormalisation( img, xPosPupil, yPosPupil, rPupil , xPosIris , yPosIris , rIris, 'DebugMode', 1 );
%todo: remove for-loop for line detection
if(size(img, 3) == 3) % if RGB image is inputted
img = rgb2gray(img);
end
% parse input
p = inputParser();
addRequired( p , 'xPosPupil' , @isnumeric );
addRequired( p , 'yPosPupil' , @isnumeric );
addRequired( p , 'rPupil' , @isnumeric );
addRequired( p , 'xPosIris' , @isnumeric );
addRequired( p , 'yPosIris' , @isnumeric );
addRequired( p , 'rIris' , @isnumeric );
addOptional( p , 'AngleSamples', 360 ,@isnumeric );
addOptional( p , 'RadiusSamples', 360 ,@isnumeric );
addOptional( p , 'DebugMode', 0, @isnumeric );
addOptional( p , 'UseInterpolation', 1, @isnumeric );
parse( p , xPosPupil, yPosPupil, rPupil , xPosIris , yPosIris , rIris , varargin{:} )
% Normalize the iris region according to daugmans model
% irisRegion = rubberSheetNormalisation( img, xPosPupil, yPosPupil, rPupil , xPosIris , yPosIris , rIris, 'DebugMode', 1 );
% Note that internally matrix coordinates are used
xp = p.Results.yPosPupil;
yp = p.Results.xPosPupil;
rp = p.Results.rPupil;
xi = p.Results.yPosIris;
yi = p.Results.xPosIris;
ri = p.Results.rIris;
angleSamples = p.Results.AngleSamples;
RadiusSamples = p.Results.RadiusSamples;
debug = p.Results.DebugMode;
interpolateQ = p.Results.UseInterpolation;
% Initialize samples
angles = (0:pi/angleSamples:pi-pi/angleSamples) + pi/(2*angleSamples);%avoiding infinite slope
r = 0:1/RadiusSamples:1;
nAngles = length(angles);
% Calculate pupil points and iris points that are on the same line
x1 = ones(size(angles))*xi;
y1 = ones(size(angles))*yi;
x2 = xi + 10*sin(angles);
y2 = yi + 10*cos(angles);
dx = x2 - x1;
dy = y2 - y1;
slope = dy./dx;
intercept = yi - xi .* slope;
xout = zeros(nAngles,2);
yout = zeros(nAngles,2);
for i = 1:nAngles
[xout(i,:),yout(i,:)] = linecirc(slope(i),intercept(i),xp,yp,rp);
end
% Get samples on limbus boundary
xRightIris = yi + ri * cos(angles);
yRightIris = xi + ri * sin(angles);
xLeftIris = yi - ri * cos(angles);
yLeftIris = xi - ri * sin(angles);
% Get samples in radius direction
xrt = (1-r)' * xout(:,1)' + r' * yRightIris;
yrt = (1-r)' * yout(:,1)' + r' * xRightIris;
xlt = (1-r)' * xout(:,2)' + r' * yLeftIris;
ylt = (1-r)' * yout(:,2)' + r' * xLeftIris;
% Create Normalized Iris Image
if interpolateQ
image = uint8(reshape(interp2(double(img),[yrt(:);ylt(:)],[xrt(:);xlt(:)]),length(r), 2*length(angles))');
else
image = reshape(img(sub2ind(size(img),round([xrt(:);xlt(:)]),round([yrt(:);ylt(:)]))),length(r), 2*length(angles));
end
% Show all points on original input image
if debug
img = insertShape(img, 'circle', [yrt(:),xrt(:),2*ones(size(xrt(:)))],'Color','r');
img = insertShape(img, 'circle', [ylt(:),xlt(:),2*ones(size(xrt(:)))],'Color','r');
figure('name','Sample scheme of the rubber sheet normalization');
imshow(img);
drawnow;
end
% Show Resulting image
figure(2);
imshow(irisRegion);
end

Frank Martin
2019 年 4 月 16 日
I feel this is no longer in the scope of providing support for my script, as these are more general Matlab questions. I recommend you follow some basic Matlab tutorials from:
syahira samsudin
2019 年 4 月 16 日
okay thank you sir
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Tracking and Motion Estimation についてさらに検索
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
