title: Different result from pcl::MomentOfInertiaEstimation and pcl::CropBox?
body: <p>I am trying to get an OBB from a point cloud, and I have got a right result using pcl::MomentOfInertiaEstimation method .I want to extract the points from the OBB using CropBox, but I got much less points than original point cloud ,maybe there's something wrong in my rotation vector:v, I'm not quiet sure. Can anyone help me? </p>
  
  <pre><code>struct BoundingBox{ 
          pcl::PointXYZ min_point_OBB; 
          pcl::PointXYZ max_point_OBB; 
          pcl::PointXYZ position_OBB; 
          Eigen::Matrix3f rotational_matrix_OBB; 
          pcl::PointXYZ center; 
          pcl::PointXYZ x_axis; 
          pcl::PointXYZ y_axis; 
          pcl::PointXYZ z_axis; 
  
  }; 
  BoundingBox getOBB(pcl::PointCloud&lt;pcl::PointXYZ&gt;::Ptr  cloud,BoundingBox OBB ) 
  { 
    pcl::MomentOfInertiaEstimation &lt;pcl::PointXYZ&gt; feature_extractor; 
    feature_extractor.setInputCloud (cloud); 
    feature_extractor.compute (); 
    feature_extractor.getOBB (OBB.min_point_OBB, OBB.max_point_OBB, OBB.position_OBB, OBB.rotational_matrix_OBB); 
   return OBB; 
  }   
  
  int main(void){ 
  BoundingBox OBB; 
  OBB=getOBB(Npoints,OBB);                   //Npoints is a part of the whole cloud 
  Eigen::Quaternionf quat (OBB.rotational_matrix_OBB); 
  Eigen::Vector3f position (OBB.position_OBB.x, OBB.position_OBB.y, OBB.position_OBB.z); 
   pcl::visualization::PCLVisualizer viewer; 
  pcl::visualization::PointCloudColorHandlerCustom&lt;pcl::PointXYZ&gt; points_color_handler (cloud, 255, 255, 255); 
   viewer.addCube (position, quat, OBB.max_point_OBB.x - OBB.min_point_OBB.x, OBB.max_point_OBB.y - OBB.min_point_OBB.y, OBB.max_point_OBB.z - OBB.min_point_OBB.z,"OBB"); 
  viewer.setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_REPRESENTATION, pcl::visualization::PCL_VISUALIZER_REPRESENTATION_WIREFRAME,"OBB"); 
  ////////////////above result is correct//////////////////// 
   Eigen::Vector4f max_point_OBB(OBB.max_point_OBB.x,OBB.max_point_OBB.y,OBB.max_point_OBB.z,1.0); 
  Eigen::Vector4f min_point_OBB(OBB.min_point_OBB.x,OBB.min_point_OBB.y,OBB.min_point_OBB.z,1.0); 
  pcl::PointCloud&lt;pcl::PointXYZ&gt;::Ptr cloudOut (new pcl::PointCloud&lt;pcl::PointXYZ&gt;); 
  pcl::CropBox&lt;pcl::PointXYZ&gt; boxfilter; 
  boxfilter.setMax(max_point_OBB);         
  boxfilter.setMin(min_point_OBB); 
  Eigen::Vector3f v = quat.vec(); 
  boxfilter.setTranslation(position); 
  boxfilter.setRotation(v); 
  boxfilter.setInputCloud(cloud); 
  boxfilter.filter (*cloudOut); 
   /////////cloulOut includes much less points than Npoints///////// 
  </code></pre>
  
  <p>looking for an answer! </p>