diff --git a/filters/include/pcl/filters/impl/crop_box.hpp b/filters/include/pcl/filters/impl/crop_box.hpp index a6dd9848aef..49c0404454f 100644 --- a/filters/include/pcl/filters/impl/crop_box.hpp +++ b/filters/include/pcl/filters/impl/crop_box.hpp @@ -90,10 +90,6 @@ pcl::CropBox::applyFilter (std::vector &indices) inverse_transform = transform.inverse (); } - bool transform_matrix_is_identity = transform_.matrix ().isIdentity (); - bool translation_is_zero = (translation_ != Eigen::Vector3f::Zero ()); - bool inverse_transform_matrix_is_identity = inverse_transform.matrix ().isIdentity (); - for (size_t index = 0; index < indices_->size (); ++index) { if (!input_->is_dense) @@ -105,10 +101,10 @@ pcl::CropBox::applyFilter (std::vector &indices) PointT local_pt = input_->points[(*indices_)[index]]; // Transform point to world space - if (!transform_matrix_is_identity) + if (!transform_.matrix ().isIdentity ()) local_pt = pcl::transformPoint (local_pt, transform_); - if (translation_is_zero) + if (translation_ != Eigen::Vector3f::Zero ()) { local_pt.x -= translation_ (0); local_pt.y -= translation_ (1); @@ -116,7 +112,7 @@ pcl::CropBox::applyFilter (std::vector &indices) } // Transform point to local space of crop box - if (!inverse_transform_matrix_is_identity) + if (!inverse_transform.matrix ().isIdentity ()) local_pt = pcl::transformPoint (local_pt, inverse_transform); // If outside the cropbox