Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix possibly uninitialized memory. Add documentation. #11013

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions wrappers/python/pyrsutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ void init_util(py::module &m) {
const rs2_extrinsics& color_to_depth, const rs2_extrinsics& depth_to_color,
std::array<float, 2> from_pixel)->std::array<float, 2>
{
std::array<float, 2> to_pixel;
std::array<float, 2> to_pixel{-1.0f, -1.0f};
rs2_project_color_pixel_to_depth_pixel(to_pixel.data(), static_cast<const uint16_t*>(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 **/
}