class_docstr: Warp a patch by depth.
  
  .. math::
      P_{src}^{\{dst\}} = K_{dst} * T_{src}^{\{dst\}}
  
      I_{src} = \\omega(I_{dst}, P_{src}^{\{dst\}}, D_{src})
  
  Args:
      pinholes_dst: the pinhole models for the destination frame.
      height: the height of the image to warp.
      width: the width of the image to warp.
      mode: interpolation mode to calculate output values ``'bilinear'`` | ``'nearest'``.
      padding_mode: padding mode for outside grid values ``'zeros'`` | ``'border'`` | ``'reflection'``.
      align_corners: interpolation flag.
class_docstr_tok: ["Warp","a","patch","by","depth",".","..","math",":",":","P_","{","src","}","^","{","\\","{","dst\\","}","}","=","K_","{","dst","}","*","T_","{","src","}","^","{","\\","{","dst\\","}","}","I_","{","src","}","=","\\\\omega","(","I_","{","dst","}",",","P_","{","src","}","^","{","\\","{","dst\\","}","}",",","D_","{","src","}",")","Args",":","pinholes_dst",":","the","pinhole","models","for","the","destination","frame",".","height",":","the","height","of","the","image","to","warp",".","width",":","the","width","of","the","image","to","warp",".","mode",":","interpolation","mode","to","calculate","output","values","``","'bilinear","'","``","|","``","'nearest","'","``",".","padding_mode",":","padding","mode","for","outside","grid","values","``","'zeros","'","``","|","``","'border","'","``","|","``","'reflection","'","``",".","align_corners",":","interpolation","flag","."]
docstr: Compute the projection matrix from the source to destination frame.
docstr_tok: ["Compute","the","projection","matrix","from","the","source","to","destination","frame","."]
code: def compute_projection_matrix(
      self, pinhole_src: PinholeCamera
  ) -> DepthWarper:
      r"""Compute the projection matrix from the source to destination frame."""
      if not isinstance(self._pinhole_dst, PinholeCamera):
          raise TypeError(
              f"Member self._pinhole_dst expected to be of class PinholeCamera. Got {type(self._pinhole_dst)}"
          )
      if not isinstance(pinhole_src, PinholeCamera):
          raise TypeError(
              f"Argument pinhole_src expected to be of class PinholeCamera. Got {type(pinhole_src)}"
          )
      # compute the relative pose between the non reference and the reference
      # camera frames.
      dst_trans_src: Tensor = compose_transformations(
          self._pinhole_dst.extrinsics,
          inverse_transformation(pinhole_src.extrinsics),
      )
  
      # compute the projection matrix between the non reference cameras and
      # the reference.
      dst_proj_src: Tensor = torch.matmul(
          self._pinhole_dst.intrinsics, dst_trans_src
      )
  
      # update class members
      self._pinhole_src = pinhole_src
      self._dst_proj_src = dst_proj_src
      return self
  
imports: from __future__ import annotations
  from typing import Optional
  import torch
  import kornia.core
  from kornia.core import Module, Tensor, tensor
  from kornia.core.check import KORNIA_CHECK, KORNIA_CHECK_IS_TENSOR, KORNIA_CHECK_SHAPE
  from kornia.filters.sobel import spatial_gradient
  from kornia.utils import create_meshgrid
  from kornia.utils.helpers import deprecated
  from .camera import PinholeCamera, cam2pixel, pixel2cam, project_points, unproject_points
  from .conversions import normalize_pixel_coordinates, normalize_points_with_intrinsics
  from .linalg import compose_transformations, convert_points_to_homogeneous, inverse_transformation, transform_points
label_desc: Use image node_id 3 for calling the DepthWarper obj's underlying member method code with example usage: obj.compute_projection_matrix(pinhole_src) and returns: self