PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
10.01k stars 4.62k forks source link

Fix behaviour of eigen33 function if smallest eigenvalue is not unique #5956

Closed mvieth closed 9 months ago

mvieth commented 9 months ago

The documentation of the eigen33 function says: "if the smallest eigenvalue is not unique, this function may return any eigenvector that is consistent to the eigenvalue" Currently however, in that case the returned eigenvector is usually a vector of NaNs. This commit applies the same logic as the other eigen33 function below. The effect on run time is minimal (one subtraction and one comparison). In practice, it is rare that the smallest eigenvalue is not unique but it can happen, for example when normals are estimated with a very small neighbourhood. In the PCL tests, this is the case in the NormalRefinement test in test_filters.cpp

See also https://github.com/PointCloudLibrary/pcl/issues/5940 Thanks to @QiMingZhenFan for reporting this issue.