GUI export: added mesh quadric decimation factor option

This commit is contained in:
matlabbe
2015-08-24 12:49:45 -04:00
parent 698ae0eeda
commit 45877e7486
8 changed files with 144 additions and 27 deletions
@@ -84,6 +84,8 @@ void RTABMAP_EXP adjustNormalsToViewPoints(
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
int k = 0); // optional: recompute normal with k neighbors (min k=3)
pcl::PolygonMesh::Ptr RTABMAP_EXP meshDecimation(const pcl::PolygonMesh::Ptr & mesh, float factor);
template<typename pointT>
std::vector<pcl::Vertices> normalizePolygonsSide(
const pcl::PointCloud<pointT> & cloud,
+11 -2
View File
@@ -36,8 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <pcl/features/normal_3d.h>
#include <pcl/surface/mls.h>
#include <pcl/surface/texture_mapping.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/surface/vtk_smoothing/vtk_mesh_quadric_decimation.h>
namespace rtabmap
{
@@ -381,6 +380,16 @@ void adjustNormalsToViewPoints(
}
}
pcl::PolygonMesh::Ptr meshDecimation(const pcl::PolygonMesh::Ptr & mesh, float factor)
{
pcl::MeshQuadricDecimationVTK mqd;
mqd.setTargetReductionFactor(factor);
mqd.setInputMesh(mesh);
pcl::PolygonMesh::Ptr output(new pcl::PolygonMesh);
mqd.process (*output);
return output;
}
}
}