You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get strange result from my realsense Z16 depth images, which has the depths stored as uint16_t (little-endian).
open3d PointCloud::CreateFromDepthImage only accepts num_channels == 1 and bytes_per_channel == 2 and converts the values then via Image::ConvertDepthToFloatImage. The other accepted format is float32 as bytes_per_channel_ == 4. This is fine.
But ConvertDepthToFloatImage does float *p = output->PointerAt<float>(x, y); which accesses the data as float32 array for an uint16 image. Which looks wrong.
The final image looks good though. There must be some confusion somewhere, which I cannot find.
It should really convert the uint16 to float per value first.
- Operating system: Ubuntu 24.04
- Open3D version: latest main 553ca86cc11d57324b84eb96ae7cda5c90011091
- System architecture: x86
- Compiler version (if built from source): gcc 13
Additional information
No response
The text was updated successfully, but these errors were encountered:
As workaround I have to create a FloatImage and create the pixels by myself.
geometry::Image gimage;
auto image = gimage.CreateFloatImage();
//o3d can only handle float images, not others. despite documented otherwise
image->Prepare(width, height, /* num_channels */1, /* bytes_per_channel */4);
for (int k = 0; k < depths.size(); k++) {
constint x = k % width;
constint y = k / width;
float *p = image->PointerAt<float>(x, y);
*p = depths[k] * 0.001; // mm to m
}
Checklist
main
branch).Describe the issue
I get strange result from my realsense Z16 depth images, which has the depths stored as uint16_t (little-endian).
open3d PointCloud::CreateFromDepthImage only accepts num_channels == 1 and bytes_per_channel == 2 and converts the values then via Image::ConvertDepthToFloatImage. The other accepted format is float32 as bytes_per_channel_ == 4. This is fine.
But ConvertDepthToFloatImage does
float *p = output->PointerAt<float>(x, y);
which accesses the data as float32 array for an uint16 image. Which looks wrong.The final image looks good though. There must be some confusion somewhere, which I cannot find.
It should really convert the uint16 to float per value first.
Steps to reproduce the bug
Error message
No response
Expected behavior
No response
Open3D, Python and System information
Additional information
No response
The text was updated successfully, but these errors were encountered: