Beispiel #1
0
def transform_warp_impl3d(
    src: torch.Tensor,
    dst_pix_trans_src_pix: torch.Tensor,
    dsize_src: Tuple[int, int, int],
    dsize_dst: Tuple[int, int, int],
    grid_mode: str,
    padding_mode: str,
    align_corners: bool,
) -> torch.Tensor:
    """Compute the transform in normalized cooridnates and perform the warping."""
    dst_norm_trans_src_norm: torch.Tensor = normalize_homography3d(dst_pix_trans_src_pix, dsize_src, dsize_dst)

    src_norm_trans_dst_norm = torch.inverse(dst_norm_trans_src_norm)
    return homography_warp3d(src, src_norm_trans_dst_norm, dsize_dst, grid_mode, padding_mode, align_corners, True)
Beispiel #2
0
def homography_warp3d(patch_src: torch.Tensor,
                      src_homo_dst: torch.Tensor,
                      dsize: Tuple[int, int, int],
                      mode: str = 'bilinear',
                      padding_mode: str = 'zeros',
                      align_corners: bool = False,
                      normalized_coordinates: bool = True) -> torch.Tensor:
    __doc__ = HMW.homography_warp3d.__doc__
    warnings.warn(
        "`homography_warp3d` is deprecated and will be removed > 0.6.0. "
        "Please use `kornia.geometry.transform.homography_warp3d instead.`",
        DeprecationWarning,
        stacklevel=2)
    return HMW.homography_warp3d(patch_src, src_homo_dst, dsize, mode,
                                 padding_mode, align_corners,
                                 normalized_coordinates)