🐍 Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
Deprecated decorator `depth_to_3d` (#2636)
João Gustavo A. Amorimc4f98c56230f
diff --git a/kornia/geometry/depth.py b/kornia/geometry/depth.pyindex 9757ea778..9641a9ec9 100644--- a/kornia/geometry/depth.py+++ b/kornia/geometry/depth.py@@ -10,6 +10,7 @@ from kornia.core import Module, Tensor, tensorfrom kornia.core.check import KORNIA_CHECK, KORNIA_CHECK_IS_TENSOR, KORNIA_CHECK_SHAPEfrom kornia.filters.sobel import spatial_gradientfrom kornia.utils import create_meshgrid+from kornia.utils.helpers import deprecatedfrom .camera import PinholeCamera, cam2pixel, pixel2cam, project_points, unproject_pointsfrom .conversions import normalize_pixel_coordinates, normalize_points_with_intrinsics@@ -71,6 +72,8 @@ def unproject_meshgrid(def depth_to_3d_v2(depth: Tensor, camera_matrix: Tensor, normalize_points: bool = False, xyz_grid: Optional[Tensor] = None) -> Tensor:+ # NOTE: when this replaces the `depth_to_3d` behaviour, a deprecated function should be added here, instead+ # of just replace the other function."""Compute a 3d point per pixel given its depth value and the camera intrinsics... note::@@ -107,9 +110,14 @@ def depth_to_3d_v2(return points_xyz * depth[..., None] # HxWx3-# NOTE: this function should replace the old depth_to_3d--+@deprecated(+ replace_with="depth_to_3d_v2",+ version='0.7.0',+ extra_reason=(+ ' This function will be replaced with the `depth_to_3d_v2` behaviour, where the that does not require the'+ ' creation of a meshgrid. The return shape can be not backward compatible between these implementations.'+ ),+)def depth_to_3d(depth: Tensor, camera_matrix: Tensor, normalize_points: bool = False) -> Tensor:"""Compute a 3d point per pixel given its depth value and the camera intrinsics.