Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add FLARELocalReferenceFrameEstimation class
Browse files Browse the repository at this point in the history
- Add FLARELocalReferenceFrameEstimation class
- Add unit test for FLARELocalReferenceFrameEstimation class
- Add LRF_utils.h
- Add LRF_utils.cpp
- Add directedOrthogonalAxis, projectPointOnPlane in lrf_utils
- getAngleBetweenUnitVectors, randomOrthogonalAxis, normalDisambiguation
and planeFitting methods of BOARDLocalReferenceFrameEstimation class
moved to lrf_utils.hpp
aliosciapetrelli committed Jun 9, 2016
1 parent e6e986d commit 0fdfc24
Showing 11 changed files with 1,283 additions and 226 deletions.
6 changes: 6 additions & 0 deletions features/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ if(build)
"include/pcl/${SUBSYS_NAME}/boost.h"
"include/pcl/${SUBSYS_NAME}/eigen.h"
"include/pcl/${SUBSYS_NAME}/board.h"
"include/pcl/${SUBSYS_NAME}/flare.h"
"include/pcl/${SUBSYS_NAME}/brisk_2d.h"
"include/pcl/${SUBSYS_NAME}/cppf.h"
"include/pcl/${SUBSYS_NAME}/cvfh.h"
@@ -31,6 +32,7 @@ if(build)
"include/pcl/${SUBSYS_NAME}/intensity_gradient.h"
"include/pcl/${SUBSYS_NAME}/intensity_spin.h"
"include/pcl/${SUBSYS_NAME}/linear_least_squares_normal.h"
"include/pcl/${SUBSYS_NAME}/lrf_utils.h"
"include/pcl/${SUBSYS_NAME}/moment_invariants.h"
"include/pcl/${SUBSYS_NAME}/moment_of_inertia_estimation.h"
"include/pcl/${SUBSYS_NAME}/multiscale_feature_persistence.h"
@@ -66,6 +68,7 @@ if(build)

set(impl_incs
"include/pcl/${SUBSYS_NAME}/impl/board.hpp"
"include/pcl/${SUBSYS_NAME}/impl/flare.hpp"
"include/pcl/${SUBSYS_NAME}/impl/brisk_2d.hpp"
"include/pcl/${SUBSYS_NAME}/impl/cppf.hpp"
"include/pcl/${SUBSYS_NAME}/impl/cvfh.hpp"
@@ -81,6 +84,7 @@ if(build)
"include/pcl/${SUBSYS_NAME}/impl/intensity_gradient.hpp"
"include/pcl/${SUBSYS_NAME}/impl/intensity_spin.hpp"
"include/pcl/${SUBSYS_NAME}/impl/linear_least_squares_normal.hpp"
"include/pcl/${SUBSYS_NAME}/impl/lrf_utils.hpp"
"include/pcl/${SUBSYS_NAME}/impl/moment_invariants.hpp"
"include/pcl/${SUBSYS_NAME}/impl/moment_of_inertia_estimation.hpp"
"include/pcl/${SUBSYS_NAME}/impl/multiscale_feature_persistence.hpp"
@@ -114,6 +118,7 @@ if(build)

set(srcs
src/board.cpp
src/flare.cpp
src/brisk_2d.cpp
src/boundary.cpp
src/cppf.cpp
@@ -127,6 +132,7 @@ if(build)
src/intensity_gradient.cpp
src/intensity_spin.cpp
src/linear_least_squares_normal.cpp
src/lrf_utils.cpp
src/moment_invariants.cpp
src/moment_of_inertia_estimation.cpp
src/multiscale_feature_persistence.cpp
76 changes: 0 additions & 76 deletions features/include/pcl/features/board.h
Original file line number Diff line number Diff line change
@@ -258,82 +258,6 @@ namespace pcl
virtual void
computeFeature (PointCloudOut &output);

/** \brief Given an axis (with origin axis_origin), return the orthogonal axis directed to point.
*
* \note axis must be normalized.
*
* \param[in] axis the axis
* \param[in] axis_origin the axis_origin
* \param[in] point the point towards which the resulting axis is directed
* \param[out] directed_ortho_axis the directed orthogonal axis calculated
*/
void
directedOrthogonalAxis (Eigen::Vector3f const &axis, Eigen::Vector3f const &axis_origin,
Eigen::Vector3f const &point, Eigen::Vector3f &directed_ortho_axis);

/** \brief return the angle (in radians) that rotate v1 to v2 with respect to axis .
*
* \param[in] v1 the first vector
* \param[in] v2 the second vector
* \param[in] axis the rotation axis. Axis must be normalized and orthogonal to plane defined by v1 and v2.
* \return angle
*/
float
getAngleBetweenUnitVectors (Eigen::Vector3f const &v1, Eigen::Vector3f const &v2, Eigen::Vector3f const &axis);

/** \brief Disambiguates a normal direction using adjacent normals
*
* \param[in] normals_cloud a cloud of normals used for the calculation
* \param[in] normal_indices the indices of the normals in the cloud that should to be used for the calculation
* \param[in,out] normal the normal to disambiguate, the calculation is performed in place
*/
void
normalDisambiguation (pcl::PointCloud<PointNT> const &normals_cloud, std::vector<int> const &normal_indices,
Eigen::Vector3f &normal);

/** \brief Compute Least Square Plane Fitting in a set of 3D points
*
* \param[in] points Matrix(nPoints,3) of 3D points coordinates
* \param[out] center centroid of the distribution of points that belongs to the fitted plane
* \param[out] norm normal to the fitted plane
*/
void
planeFitting (Eigen::Matrix<float, Eigen::Dynamic, 3> const &points, Eigen::Vector3f &center,
Eigen::Vector3f &norm);

/** \brief Given a plane (origin and normal) and a point, return the projection of x on plane
*
* Equivalent to vtkPlane::ProjectPoint()
*
* \param[in] point the point to project
* \param[in] origin_point a point belonging to the plane
* \param[in] plane_normal normal of the plane
* \param[out] projected_point the projection of the point on the plane
*/
void
projectPointOnPlane (Eigen::Vector3f const &point, Eigen::Vector3f const &origin_point,
Eigen::Vector3f const &plane_normal, Eigen::Vector3f &projected_point);

/** \brief Given an axis, return a random orthogonal axis
*
* \param[in] axis input axis
* \param[out] rand_ortho_axis an axis orthogonal to the input axis and whose direction is random
*/
void
randomOrthogonalAxis (Eigen::Vector3f const &axis, Eigen::Vector3f &rand_ortho_axis);

/** \brief Check if val1 and val2 are equals.
*
* \param[in] val1 first number to check.
* \param[in] val2 second number to check.
* \param[in] zero_float_eps epsilon
* \return true if val1 is equal to val2, false otherwise.
*/
inline bool
areEquals (float val1, float val2, float zero_float_eps = 1E-8f) const
{
return (std::abs (val1 - val2) < zero_float_eps);
}

private:
/** \brief Radius used to find tangent axis. */
Loading

0 comments on commit 0fdfc24

Please sign in to comment.