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 projection of point cloud with no positions attribute to image #6880

Merged
merged 3 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
- Fix segmentation fault (infinite recursion) of DetectPlanarPatches if multiple points have same coordinates (PR #6794)
- Fix build with fmt v10.2.0 (#6783)
- Fix segmentation fault (lambda reference capture) of VisualizerWithCustomAnimation::Play (PR #6804)
- Fix projection of point cloud to Depth/RGBD image if no position attribute is provided (PR #6880)

## 0.13

Expand Down
12 changes: 12 additions & 0 deletions cpp/open3d/t/geometry/PointCloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,12 @@ geometry::Image PointCloud::ProjectToDepthImage(int width,
const core::Tensor &extrinsics,
float depth_scale,
float depth_max) {
if (!HasPointPositions()) {
utility::LogWarning(
"Called ProjectToDepthImage on a point cloud with no Positions "
"attribute. Returning empty image.");
return geometry::Image();
}
core::AssertTensorShape(intrinsics, {3, 3});
core::AssertTensorShape(extrinsics, {4, 4});

Expand All @@ -1001,6 +1007,12 @@ geometry::RGBDImage PointCloud::ProjectToRGBDImage(
const core::Tensor &extrinsics,
float depth_scale,
float depth_max) {
if (!HasPointPositions()) {
utility::LogWarning(
"Called ProjectToRGBDImage on a point cloud with no Positions "
"attribute. Returning empty image.");
return geometry::RGBDImage();
}
if (!HasPointColors()) {
utility::LogError(
"Unable to project to RGBD without the Color attribute in the "
Expand Down
Loading