parameters: (points1, points2,doscale=False)
return_statement: return T
docstring: Finds an affine k+1xk+1 transformation T such that T*transpose(points1)=transpose(points2). points1, points2 is a Nxk array
docstring_summary: Finds an affine k+1xk+1 transformation T such that T*transpose(points1)=transpose(points2). points1, points2 is a Nxk array
docstring_tokens: Finds an affine k + 1xk + 1 transformation T such that T * transpose ( points1 ) = transpose ( points2 ) . points1 points2 is a Nxk array
function: def ComputeRigidTransform(points1, points2,doscale=False):
          """Finds an affine k+1xk+1 transformation T such that T*transpose(points1)=transpose(points2). points1, points2 is a Nxk array"""
          assert(points1.shape == points2.shape)
          N = points1.shape[0]
          points1mean = mean(points1,0)
          points2mean = mean(points2,0)
          [U,s,Vh] = svd( dot(transpose(points1-tile(points1mean,(N,1))),points2-tile(points2mean,(N,1))) )
          I = eye(points1.shape[1])
          I[-1,-1] = det(dot(U,Vh))
          R = transpose(dot(dot(U,I),Vh))
          if doscale:
              R = dot(R, diag(s))
          T = eye(points1.shape[1]+1)
          T[0:-1,0:-1] = R
          T[0:-1,-1] = points2mean-dot(R,points1mean)
          return T
function_tokens: def ComputeRigidTransform ( points1 , points2 , doscale = False ) : assert ( points1 . shape == points2 . shape ) N = points1 . shape [ 0 ] points1mean = mean ( points1 , 0 ) points2mean = mean ( points2 , 0 ) [ U , s , Vh ] = svd ( dot ( transpose ( points1 - tile ( points1mean , ( N , 1 ) ) ) , points2 - tile ( points2mean , ( N , 1 ) ) ) ) I = eye ( points1 . shape [ 1 ] ) I [ - 1 , - 1 ] = det ( dot ( U , Vh ) ) R = transpose ( dot ( dot ( U , I ) , Vh ) ) if doscale : R = dot ( R , diag ( s ) ) T = eye ( points1 . shape [ 1 ] + 1 ) T [ 0 : - 1 , 0 : - 1 ] = R T [ 0 : - 1 , - 1 ] = points2mean - dot ( R , points1mean ) return T