mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
GUI export: added mesh quadric decimation factor option
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user