Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

1003 B
Raw Blame

warp_grid, warp_grid3d, get_translation_matrix2d, get_projective_transform and get_affine_matrix3d, and through them homography_warp (with the default normalized_homography=True), homography_warp3d and HomographyWarper, now raise a ShapeError for an input of an unsupported rank instead of misreading it. An unbatched (3, 3) or (4, 4) homography used to have its first dimension taken as the batch size and its one matrix applied to every sample, so warp_grid returned 3 grids and homography_warp worked for exactly 3 images; a (2,) translation gave two matrices. Pass one homography per image, (B, 3, 3), or (B, 4, 4) for the 3D functions (M.expand(B, -1, -1) shares one matrix across the batch), translations as (B, 2), and scales as (B, 3) per axis or (B, 1) per sample, with (3,) or (1, 3) for shared (sx, sy, sz). Working scale inputs retain their behavior; use (B, 1) for per-sample isotropic factors rather than the previously documented (B,).