Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need explanation of this matlab file ridgeorient.m

Status
Not open for further replies.

leekk8

Full Member level 5
Joined
Sep 6, 2005
Messages
309
Helped
35
Reputation
70
Reaction score
18
Trophy points
1,298
Location
Malaysia
Activity points
3,817
This is a matlab file computing the orientation field of a fingerprint. However, I may need the mathematical equation or theory of this code. Please help if anyone understand this. TQ

function [orientim, reliability] = ...
ridgeorient(im, gradientsigma, blocksigma, orientsmoothsigma)

[rows,cols] = size(im);

% Calculate image gradients.
sze = fix(6*gradientsigma); if ~mod(sze,2); sze = sze+1; end
f = fspecial('gaussian', sze, gradientsigma); % Generate Gaussian filter.
[fx,fy] = gradient(f); % Gradient of Gausian.

Gx = filter2(fx, im); % Gradient of the image in x
Gy = filter2(fy, im); % ... and y

% Estimate the local ridge orientation at each point by finding the
% principal axis of variation in the image gradients.

Gxx = Gx.^2; % Covariance data for the image gradients
Gxy = Gx.*Gy;
Gyy = Gy.^2;

% Now smooth the covariance data to perform a weighted summation of the
% data.
sze = fix(6*blocksigma); if ~mod(sze,2); sze = sze+1; end
f = fspecial('gaussian', sze, blocksigma);
Gxx = filter2(f, Gxx);
Gxy = 2*filter2(f, Gxy);
Gyy = filter2(f, Gyy);

% Analytic solution of principal direction
denom = sqrt(Gxy.^2 + (Gxx - Gyy).^2) + eps;
sin2theta = Gxy./denom; % Sine and cosine of doubled angles
cos2theta = (Gxx-Gyy)./denom;

sze = fix(6*orientsmoothsigma); if ~mod(sze,2); sze = sze+1; end
f = fspecial('gaussian', sze, orientsmoothsigma);
cos2theta = filter2(f, cos2theta); % Smoothed sine and cosine of
sin2theta = filter2(f, sin2theta); % doubled angles

orientim = pi/2 + atan2(sin2theta,cos2theta)/2;
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top