diff --git a/filters/include/pcl/filters/box_clipper3D.h b/filters/include/pcl/filters/box_clipper3D.h index b2ebfa51f78..feade7de860 100644 --- a/filters/include/pcl/filters/box_clipper3D.h +++ b/filters/include/pcl/filters/box_clipper3D.h @@ -46,7 +46,8 @@ namespace pcl /** * \author Suat Gedikli * \brief Implementation of a box clipper in 3D. Actually it allows affine transformations, thus any parallelepiped in general pose. - * The affine transformation is used to transform the point before clipping it using the unit cube centered at origin and with an extend of -1 to +1 in each dimension + * The affine transformation is used to transform the point before clipping it using a cube centered at origin and with an extend of -1 to +1 in each dimension + * \sa CropBox * \ingroup filters */ template @@ -61,7 +62,7 @@ namespace pcl /** * \author Suat Gedikli * \brief Constructor taking an affine transformation matrix, which allows also shearing of the clipping area - * \param[in] transformation the 3x3 affine transformation matrix that is used to describe the unit cube + * \param[in] transformation the 3 dimensional affine transformation that is used to describe the cube ([-1; +1] in each dimension). The transformation is applied to the point(s)! */ BoxClipper3D (const Eigen::Affine3f& transformation); @@ -75,7 +76,7 @@ namespace pcl /** * \brief Set the affine transformation - * \param[in] transformation + * \param[in] transformation applied to the point(s) */ void setTransformation (const Eigen::Affine3f& transformation); @@ -115,7 +116,7 @@ namespace pcl void transformPoint (const PointT& pointIn, PointT& pointOut) const; private: /** - * \brief the affine transformation that is applied before clipping is done on the unit cube. + * \brief the affine transformation that is applied before clipping is done on the [-1; +1] cube. */ Eigen::Affine3f transformation_; diff --git a/filters/include/pcl/filters/impl/box_clipper3D.hpp b/filters/include/pcl/filters/impl/box_clipper3D.hpp index 9ef530eed72..923a3024a43 100644 --- a/filters/include/pcl/filters/impl/box_clipper3D.hpp +++ b/filters/include/pcl/filters/impl/box_clipper3D.hpp @@ -41,7 +41,6 @@ template pcl::BoxClipper3D::BoxClipper3D (const Eigen::Affine3f& transformation) : transformation_ (transformation) { - //inverse_transformation_ = transformation_.inverse (); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -61,15 +60,13 @@ template void pcl::BoxClipper3D::setTransformation (const Eigen::Affine3f& transformation) { transformation_ = transformation; - //inverse_transformation_ = transformation_.inverse (); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template void pcl::BoxClipper3D::setTransformation (const Eigen::Vector3f& rodrigues, const Eigen::Vector3f& translation, const Eigen::Vector3f& box_size) { - transformation_ = Eigen::Translation3f (translation) * Eigen::AngleAxisf(rodrigues.norm (), rodrigues.normalized ()) * Eigen::Scaling (box_size); - //inverse_transformation_ = transformation_.inverse (); + transformation_ = (Eigen::Translation3f (translation) * Eigen::AngleAxisf(rodrigues.norm (), rodrigues.normalized ()) * Eigen::Scaling (0.5f * box_size)).inverse (); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////