From 867283f88e5f9c317bc25d445f03a5f833d29232 Mon Sep 17 00:00:00 2001 From: Dominik Winkelbauer Date: Mon, 12 Feb 2024 20:46:34 +0100 Subject: [PATCH] fix(camera): Fixes depth_via_raytracing with return_dist=True --- blenderproc/python/camera/CameraProjection.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blenderproc/python/camera/CameraProjection.py b/blenderproc/python/camera/CameraProjection.py index ce1f0961b..9bf981013 100644 --- a/blenderproc/python/camera/CameraProjection.py +++ b/blenderproc/python/camera/CameraProjection.py @@ -57,8 +57,9 @@ def depth_via_raytracing(bvh_tree: BVHTree, frame: Optional[int] = None, return_ dists = np.reshape(dists, [resolution_y, resolution_x]) if not return_dist: - depth = dist2depth(dists) - return depth + return dist2depth(dists) + else: + return dists def unproject_points(points_2d: np.ndarray, depth: np.ndarray, frame: Optional[int] = None, depth_cut_off: float = 1e6) -> np.ndarray: """ Unproject 2D points into 3D