From 1f4a8bd702664fe386927ee948e0ead198caeba9 Mon Sep 17 00:00:00 2001 From: Stefan Date: Fri, 21 Oct 2022 19:14:11 +0200 Subject: [PATCH] Fix possibly uninitialized memory. Add documentation. --- wrappers/python/pyrsutil.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wrappers/python/pyrsutil.cpp b/wrappers/python/pyrsutil.cpp index 5611bda719..fbd15c21e7 100644 --- a/wrappers/python/pyrsutil.cpp +++ b/wrappers/python/pyrsutil.cpp @@ -42,15 +42,15 @@ void init_util(py::module &m) { const rs2_extrinsics& color_to_depth, const rs2_extrinsics& depth_to_color, std::array from_pixel)->std::array { - std::array to_pixel; + std::array to_pixel{-1.0f, -1.0f}; rs2_project_color_pixel_to_depth_pixel(to_pixel.data(), static_cast(data._ptr), depth_scale, depth_min, depth_max, &depth_intrin, &color_intrin, &depth_to_color, &color_to_depth, from_pixel.data()); return to_pixel; }; - m.def("rs2_project_color_pixel_to_depth_pixel", cp_to_dp, "data"_a, "depth_scale"_a, - "depth_min"_a, "depth_max"_a, "depth_intrin"_a, "color_intrin"_a, "depth_to_color"_a, + m.def("rs2_project_color_pixel_to_depth_pixel", cp_to_dp, "Given pixel coordinates of the color image and a minimum and maximum depth, compute the corresponding pixel coordinates in the depth image. Returns [-1 -1] on failure.", + "data"_a, "depth_scale"_a, "depth_min"_a, "depth_max"_a, "depth_intrin"_a, "color_intrin"_a, "depth_to_color"_a, "color_to_depth"_a, "from_pixel"_a); /** end rsutil.h **/ }