Skip to content

Commit

Permalink
Warn if projection of point cloud with no positions attribute to image (
Browse files Browse the repository at this point in the history
  • Loading branch information
rxba committed Aug 15, 2024
1 parent 48ccf2a commit 6cb32f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
- Add O3DVisualizer API to enable collapse control of verts in the side panel (PR #6865)
- Split pybind declarations/definitions to avoid C++ types in Python docs (PR #6869)
- Fix minimal oriented bounding box of MeshBase derived classes and add new unit tests (PR #6898)
- 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

0 comments on commit 6cb32f6

Please sign in to comment.