code: def estimate_affine_matrix_3d23d(X, Y):
      """Using least-squares solution
      Args:
          X: [n, 3]. 3d points(fixed)
          Y: [n, 3]. corresponding 3d points(moving). Y = PX
      Returns:
          P_Affine: (3, 4). Affine camera matrix (the third row is [0, 0, 0, 1]).
      """
      X_homo = np.hstack((X, np.ones([X.shape[1], 1])))  # n x 4
      P = np.linalg.lstsq(X_homo, Y)[0].T  # Affine matrix. 3 x 4
      return P
  
file_path: insightface/python-package/insightface/thirdparty/face3d/mesh/transform.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import math
  from math import cos, sin
label_desc: Use image node_id 10 for calling a global function with example usage: estimate_affine_matrix_3d23d(X, Y) and returns: P