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

Conversation

rxba
Copy link
Contributor

@rxba rxba commented Jul 20, 2024

Type

  • Bug fix (non-breaking change which fixes an issue): Fixes project_to_depth_image ERROR Open3D version 0.18 #6651
  • New feature (non-breaking change which adds functionality). Resolves #
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) Resolves #

Motivation and Context

Calling project_to_depth_image or project_to_rgbd_image on a o3d.t.geometry.PointCloud() with no positions attribute only throws a non-descriptive IndexError: unordered_map::at: key not found.

Checklist:

  • I have run python util/check_style.py --apply to apply Open3D code style
    to my code.
  • This PR changes Open3D behavior or adds new functionality.
    • Both C++ (Doxygen) and Python (Sphinx / Google style) documentation is
      updated accordingly.
    • I have added or updated C++ and / or Python unit tests OR included test
      results
      (e.g. screenshots or numbers) here.
  • I will follow up and update the code if CI fails.
  • For fork PRs, I have selected Allow edits from maintainers.

Description

I've prevented the failing call to kernel::pointcloud::Project() with an empty GetPointPositions() by returning an empty image if the point cloud project_to_depth_image or project_to_rgbd_image is called on does not contain the positions attribute.
Additionally, I've added a warning to inform the user of this, and to indicate to them that something else might be going wrong if they are calling these functions without positions.

Copy link

update-docs bot commented Jul 20, 2024

Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.

@rxba
Copy link
Contributor Author

rxba commented Aug 1, 2024

Not sure why some of the checks are failing, would be glad for some pointers on how to proceed by the experienced contributors. Thanks!

Copy link
Member

@ssheorey ssheorey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rxba . Looks good!

@ssheorey ssheorey merged commit 6cb32f6 into isl-org:main Aug 15, 2024
29 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

project_to_depth_image ERROR Open3D version 0.18
2 participants