code: def compute_similarity_transform(points_static, points_to_transform):
      # http://nghiaho.com/?page_id=671
      p0 = np.copy(points_static).T
      p1 = np.copy(points_to_transform).T
  
      t0 = -np.mean(p0, axis=1).reshape(3, 1)
      t1 = -np.mean(p1, axis=1).reshape(3, 1)
      t_final = t1 - t0
  
      p0c = p0 + t0
      p1c = p1 + t1
  
      covariance_matrix = p0c.dot(p1c.T)
      U, S, V = np.linalg.svd(covariance_matrix)
      R = U.dot(V)
      if np.linalg.det(R) < 0:
          R[:, 2] *= -1
  
      rms_d0 = np.sqrt(np.mean(np.linalg.norm(p0c, axis=0) ** 2))
      rms_d1 = np.sqrt(np.mean(np.linalg.norm(p1c, axis=0) ** 2))
  
      s = rms_d0 / rms_d1
      P = np.c_[s * np.eye(3).dot(R), t_final]
      return P
  
file_path: PaddleHub/modules/image/image_processing/prnet/utils/estimate_pose.py
imports: from math import asin
  from math import atan2
  from math import cos
  from math import sin
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: compute_similarity_transform(points_static, points_to_transform) and returns: P