Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

Fix tensor EstimatePointWiseNormalsWithFastEigen3x3

Open nicolaloi opened this issue 1 year ago • 1 comments

Type

  • [x] Bug fix (non-breaking change which fixes an issue): Fixes #6967
  • [ ] 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

Very short PR. In the tensor module, EstimatePointWiseNormalsWithFastEigen3x3 has a small bug in computing the normal when the covariance norm is 0, setting a normal to (0,0,1) instead of the correct (0,1,0) value.

Checklist:

  • [x] 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.
  • [x] I will follow up and update the code if CI fails.
  • [x] For fork PRs, I have selected Allow edits from maintainers.

Description

Very short PR. Fix EstimatePointWiseNormalsWithFastEigen3x3 to correctly estimate the (0,1,0) normal. The if clause for the (0,1,0) normal case is incorrect, and the normal will be incorrectly estimated to be (0,0,1).

Change the covariance matrix check of EstimatePointWiseNormalsWithFastEigen3x3 from

else if (covariance_ptr[0] < covariance_ptr[4] &&
                   covariance_ptr[0] < covariance_ptr[8])

to

else if (covariance_ptr[4] < covariance_ptr[0] &&
                   covariance_ptr[4] < covariance_ptr[8])

similarly to how is done in the covariance matrix check of FastEigen3x3.

nicolaloi avatar Sep 21 '24 21:09 nicolaloi

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

update-docs[bot] avatar Sep 21 '24 21:09 update-docs[bot]