code: def estimate_transfo(xyz, xyz_target):
      """
      estimate the rotation and translation using Kabsch algorithm
      Parameters:
      xyz :
      xyz_target:
      """
      assert xyz.shape == xyz.shape
      xyz_c = xyz - xyz.mean(0)
      xyz_target_c = xyz_target - xyz_target.mean(0)
      Q = xyz_c.T.mm(xyz_target_c) / len(xyz)
      U, S, V = torch.svd(Q)
      d = torch.det(V.mm(U.T))
      diag = torch.diag(torch.tensor([1, 1, d], device=xyz.device))
      R = V.mm(diag).mm(U.T)
      t = xyz_target.mean(0) - R @ xyz.mean(0)
      T = torch.eye(4, device=xyz.device)
      T[:3, :3] = R
      T[:3, 3] = t
      return T
  
file_path: torch-points3d/torch_points3d/utils/registration.py
imports: import open3d
  import numpy
  import torch
  from torch_points3d.utils.geometry import get_trans
  from torch_geometric.nn import knn
label_desc: Use image node_id 2 for calling a global function with example usage: estimate_transfo(xyz, xyz_target) and returns: T