kornia.geometry.warp¶
- class 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 DepthWarper(pinhole_dst, height, width, mode='bilinear', padding_mode='zeros', align_corners=True)[source]¶
Warps 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
- homography_warp(patch_src, src_homo_dst, dsize, mode='bilinear', padding_mode='zeros', align_corners=False, normalized_coordinates=True)[source]¶
- Return type
- depth_warp(pinhole_dst, pinhole_src, depth_src, patch_dst, height, width, align_corners=True)[source]¶