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","."]
code: def _compute_projection(
      self, x: float, y: float, invd: float
  ) -> Tensor:
      if self._dst_proj_src is None or self._pinhole_src is None:
          raise ValueError("Please, call compute_projection_matrix.")
  
      point = tensor(
          [[[x], [y], [invd], [1.0]]],
          device=self._dst_proj_src.device,
          dtype=self._dst_proj_src.dtype,
      )
      flow = torch.matmul(self._dst_proj_src, point)
      z = 1.0 / flow[:, 2]
      _x = flow[:, 0] * z
      _y = flow[:, 1] * z
      return kornia_ops.concatenate([_x, _y], 1)
  
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 4 for calling the DepthWarper obj's underlying member method code with example usage: obj._compute_projection(x, y, invd) and returns: kornia_ops