kornia.geometry.warp

class kornia.geometry.warp.HomographyWarper(height, width, mode='bilinear', padding_mode='zeros', normalized_coordinates=True, align_corners=False)[source]

Warp tensors by homographies.

\[X_{dst} = H_{src}^{\{dst\}} * X_{src}\]
Parameters
  • height (int) – The height of the destination tensor.

  • width (int) – The width of the destination tensor.

  • mode (str, optional) – interpolation mode to calculate output values 'bilinear' | 'nearest'. Default: 'bilinear'

  • padding_mode (str, optional) – padding mode for outside grid values 'zeros' | 'border' | 'reflection'. Default: 'zeros'

  • normalized_coordinates (bool, optional) – whether to use a grid with normalized coordinates. Default: True

  • align_corners (bool, optional) – interpolation flag. Default: False

class kornia.geometry.warp.DepthWarper(pinhole_dst, height, width, mode='bilinear', padding_mode='zeros', align_corners=True)[source]

Warp a patch by depth.

\[ \begin{align}\begin{aligned}P_{src}^{\{dst\}} = K_{dst} * T_{src}^{\{dst\}}\\\begin{split}I_{src} = \\omega(I_{dst}, P_{src}^{\{dst\}}, D_{src})\end{split}\end{aligned}\end{align} \]
Parameters
  • pinholes_dst – the pinhole models for the destination frame.

  • height (int) – the height of the image to warp.

  • width (int) – the width of the image to warp.

  • mode (str, optional) – interpolation mode to calculate output values 'bilinear' | 'nearest'. Default: 'bilinear'

  • padding_mode (str, optional) – padding mode for outside grid values 'zeros' | 'border' | 'reflection'. Default: 'zeros'

  • align_corners (bool, optional) – interpolation flag. Default: True

kornia.geometry.warp.homography_warp(patch_src, src_homo_dst, dsize, mode='bilinear', padding_mode='zeros', align_corners=False, normalized_coordinates=True)[source]
Return type

Tensor

kornia.geometry.warp.depth_warp(pinhole_dst, pinhole_src, depth_src, patch_dst, height, width, align_corners=True)[source]
kornia.geometry.warp.warp_grid(grid, src_homo_dst)[source]
Return type

Tensor

kornia.geometry.warp.normalize_homography3d(dst_pix_trans_src_pix, dsize_src, dsize_dst)[source]
Return type

Tensor

kornia.geometry.warp.normal_transform_pixel(height, width, eps=1e-14, device=None, dtype=None)[source]
Return type

Tensor

kornia.geometry.warp.normal_transform_pixel3d(depth, height, width, eps=1e-14, device=None, dtype=None)[source]
Return type

Tensor