code: def KRt_from_projection(
      P: Tensor, eps: float = 1e-6
  ) -> Tuple[Tensor, Tensor, Tensor]:
      r"""Decompose the Projection matrix into Camera-Matrix, Rotation Matrix and Translation vector.
  
      Args:
          P: the projection matrix with shape :math:`(B, 3, 4)`.
  
      Returns:
          - The Camera matrix with shape :math:`(B, 3, 3)`.
          - The Rotation matrix with shape :math:`(B, 3, 3)`.
          - The Translation vector with shape :math:`(B, 3)`.
      """
      if P.shape[-2:] != (3, 4):
          raise AssertionError("P must be of shape [B, 3, 4]")
      if len(P.shape) != 3:
          raise AssertionError
  
      submat_3x3 = P[:, 0:3, 0:3]
      last_column = P[:, 0:3, 3].unsqueeze(-1)
  
      # Trick to turn QR-decomposition into RQ-decomposition
      reverse = torch.tensor(
          [[0, 0, 1], [0, 1, 0], [1, 0, 0]],
          device=P.device,
          dtype=P.dtype,
      ).unsqueeze(0)
      submat_3x3 = torch.matmul(reverse, submat_3x3).permute(0, 2, 1)
      ortho_mat, upper_mat = linalg_qr(submat_3x3)
      ortho_mat = torch.matmul(reverse, ortho_mat.permute(0, 2, 1))
      upper_mat = torch.matmul(
          reverse, torch.matmul(upper_mat.permute(0, 2, 1), reverse)
      )
  
      # Turning the `upper_mat's` diagonal elements to positive.
      diagonals = torch.diagonal(upper_mat, dim1=-2, dim2=-1) + eps
      signs = torch.sign(diagonals)
      signs_mat = torch.diag_embed(signs)
  
      K = torch.matmul(upper_mat, signs_mat)
      R = torch.matmul(signs_mat, ortho_mat)
      t = torch.matmul(torch.inverse(K), last_column)
  
      return K, R, t
  
file_path: kornia/kornia/geometry/epipolar/projection.py
imports: from typing import Tuple, Union
  import torch
  from torch.linalg import qr
  from kornia.core import Tensor, concatenate, ones_like, pad, stack, zeros_like
  from kornia.utils import eye_like, vec_like
  from kornia.utils.helpers import _torch_svd_cast
  from .numeric import cross_product_matrix
label_desc: Use image node_id 5 for calling a global function with example usage: KRt_from_projection(P, eps) and returns: K,  R,  t