🐍 Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
Fix order of transformations in DepthWarper.compute_projection_matrix (#659)
Michał Tyszkiewicz2e5d6b84305e
diff --git a/kornia/geometry/warp/depth_warper.py b/kornia/geometry/warp/depth_warper.pyindex 4204b757c..c21e91e71 100644--- a/kornia/geometry/warp/depth_warper.py+++ b/kornia/geometry/warp/depth_warper.py@@ -3,8 +3,7 @@ import torchimport torch.nn as nnimport torch.nn.functional as F-from kornia.geometry.linalg import transform_points-from kornia.geometry.linalg import relative_transformation+from kornia.geometry.linalg import transform_points, inverse_transformation, compose_transformationsfrom kornia.geometry.conversions import convert_points_to_homogeneousfrom kornia.geometry.conversions import normalize_pixel_coordinatesfrom kornia.geometry.camera import PinholeCamera@@ -80,8 +79,10 @@ class DepthWarper(nn.Module):"PinholeCamera. Got {}".format(type(pinhole_src)))# compute the relative pose between the non reference and the reference# camera frames.- dst_trans_src: torch.Tensor = relative_transformation(- pinhole_src.extrinsics, self._pinhole_dst.extrinsics)+ dst_trans_src: torch.Tensor = compose_transformations(+ self._pinhole_dst.extrinsics,+ inverse_transformation(pinhole_src.extrinsics),+ )# compute the projection matrix between the non reference cameras and# the reference.