5
clear all; im = imread('Finger2.bmp'); W = 16; gradientsigma = 1; blocksigma = 3; orientsmoothsigma = 3; [rows,cols] = size(im); 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); Gy = filter2(fy, im); Gxx = Gx.^2; Gxy = Gx.*Gy; Gyy = Gy.^2; sze = fix(6*blocksigma); if ~mod(sze,2); sze = sze+1; end f = fspecial('gaussian', sze, blocksigma); Gxx = filter2(f, Gxx);

Poincare

Embed Size (px)

DESCRIPTION

Calculates values

Citation preview

clearall;im =imread('Finger2.bmp');W = 16;gradientsigma = 1;blocksigma = 3;orientsmoothsigma = 3;[rows,cols]=size(im);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); Gy = filter2(fy, im); Gxx = Gx.^2; Gxy = Gx.*Gy; Gyy = Gy.^2; sze = fix(6*blocksigma); if ~mod(sze,2); sze = sze+1; end f = fspecial('gaussian', sze, blocksigma); Gxx = filter2(f, Gxx); % Smoothed moments Gxy = 2*filter2(f, Gxy); Gyy = filter2(f, Gyy);denom = sqrt(Gxy.^2 + (Gxx - Gyy).^2) + eps;% Sine and cosine of doubled angles sin2theta1 = Gxy./denom; cos2theta1 = (Gxx-Gyy)./denom; sze = fix(6*orientsmoothsigma); if ~mod(sze,2); sze = sze+1; end f = fspecial('gaussian', sze, orientsmoothsigma); cos2theta = filter2(f, cos2theta1); % Smoothed sine and cosine of sin2theta = filter2(f, sin2theta1); % doubled angles orientim = pi/2 + atan2(sin2theta,cos2theta)/2; Imin = (Gyy+Gxx)/2 - (Gxx-Gyy).*cos2theta/2 - Gxy.*sin2theta/2; Imax = Gyy+Gxx - Imin; reliability = 1 - Imin./Imax;% poin care ---- A = zeros(size(orientim)); [r,c] = size(orientim) for i = 1:W:r for j = 1:W:c if j+W-1 < c & i+W-1 < r sin2theta_new(ceil(i/W),ceil(j/W)) = max(max(sin2theta(i:i+W-1,j:j+W-1))); end end end% determine poincare [rr cc] = size(sin2theta_new) temp=[]; for i=3:rr-2 for j=3:cc-2 if sin2theta(i,j) ~= 0 i j temp =[temp,sin2theta_new(i-2,j-2:j+2),sin2theta_new(i-1:i+2,j+2)',sin2theta_new(i+2,j+1:j-2),sin2theta_new(i+1:i-2,j-2)']; k = length(temp); poincare = 0; for m=1:k-1 dif = temp(m+1) - temp(m); if dif = 0.4 & poincare = -0.55 & poincare < -0.45 'hello' A(i,j) = 2; end; end; end end; max(max(heMap)) figure,imshow(im); hold on; [mm nn] =size(A); for i = 1:mmfor j = 1:nn if(A(i,j)==1) A(i,j)==255; plot(i,j,'g+'); else A(i,j) = 0; end endendtitle(A);