Skip to content

Commit 6cb32f6

Browse files
authored
Warn if projection of point cloud with no positions attribute to image (#6880)
1 parent 48ccf2a commit 6cb32f6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
- Add O3DVisualizer API to enable collapse control of verts in the side panel (PR #6865)
4343
- Split pybind declarations/definitions to avoid C++ types in Python docs (PR #6869)
4444
- Fix minimal oriented bounding box of MeshBase derived classes and add new unit tests (PR #6898)
45+
- Fix projection of point cloud to Depth/RGBD image if no position attribute is provided (PR #6880)
4546

4647
## 0.13
4748

cpp/open3d/t/geometry/PointCloud.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,12 @@ geometry::Image PointCloud::ProjectToDepthImage(int width,
983983
const core::Tensor &extrinsics,
984984
float depth_scale,
985985
float depth_max) {
986+
if (!HasPointPositions()) {
987+
utility::LogWarning(
988+
"Called ProjectToDepthImage on a point cloud with no Positions "
989+
"attribute. Returning empty image.");
990+
return geometry::Image();
991+
}
986992
core::AssertTensorShape(intrinsics, {3, 3});
987993
core::AssertTensorShape(extrinsics, {4, 4});
988994

@@ -1001,6 +1007,12 @@ geometry::RGBDImage PointCloud::ProjectToRGBDImage(
10011007
const core::Tensor &extrinsics,
10021008
float depth_scale,
10031009
float depth_max) {
1010+
if (!HasPointPositions()) {
1011+
utility::LogWarning(
1012+
"Called ProjectToRGBDImage on a point cloud with no Positions "
1013+
"attribute. Returning empty image.");
1014+
return geometry::RGBDImage();
1015+
}
10041016
if (!HasPointColors()) {
10051017
utility::LogError(
10061018
"Unable to project to RGBD without the Color attribute in the "

0 commit comments

Comments
 (0)