minuorigin_transall.m

来自「用matlab写的关于指纹识别的程序」· M 代码 · 共 44 行

M
44
字号
function [newXY] = MinuOrigin_TransAll(real_end,k)
%  MinuOrigin_all(real_end,k)
%	set the k-th minutia as origin and align its direction to zero(along x)
%  and then accomodate all other minutia points in the fingerprint to the
%  new origin
%
%  Also see MinuOrigin
%  The difference between MinuOrigin and MinuOrigin_all is that the orientation
%  of each minutia is also adjusted with the origin minutia
%Honors Project 2001~2002
%wuzhili 99050056
%comp sci HKBU
%last update 19/April/2002

theta = real_end(k,3);

if theta <0
	theta1=2*pi+theta;
end;

theta1=pi/2-theta;


rotate_mat=[cos(theta1),-sin(theta1),0;sin(theta1),cos(theta1),0;0,0,1];

      toBeTransformedPointSet = real_end';
      
      tonyTrickLength = size(toBeTransformedPointSet,2);
      
      pathStart = real_end(k,:)';
      
      translatedPointSet = toBeTransformedPointSet - pathStart(:,ones(1,tonyTrickLength));
      
      newXY = rotate_mat*translatedPointSet;
      
      %ensure the direction is in the domain[-pi,pi]
      
      for i=1:tonyTrickLength
         if or(newXY(3,i)>pi,newXY(3,i)<-pi)
            newXY(3,i) = 2*pi - sign(newXY(3,i))*newXY(3,i);
         end;
      end;
      
		

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?