141 lines
4.5 KiB
C
141 lines
4.5 KiB
C
|
/**
|
||
|
* @file PointCloudReMesh.h
|
||
|
* @brief 基于点云的网格表面重建
|
||
|
* @author 陈增辉 (3045316072@qq.com)
|
||
|
* @version 2.5.0
|
||
|
* @date 2024/4/4
|
||
|
* @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
|
||
|
*/
|
||
|
|
||
|
#ifndef LAMPCAE_POINTCLOUDMESH_H
|
||
|
#define LAMPCAE_POINTCLOUDMESH_H
|
||
|
// qt 相关头文件
|
||
|
#include <QObject>
|
||
|
|
||
|
// 常用pcl 头文件库
|
||
|
#include <pcl/io/ply_io.h>
|
||
|
#include <pcl/kdtree/kdtree_flann.h>
|
||
|
#include <pcl/point_cloud.h>
|
||
|
#include <pcl/point_types.h>
|
||
|
#include <pcl/visualization/cloud_viewer.h>
|
||
|
#include <pcl/visualization/pcl_visualizer.h>
|
||
|
|
||
|
#include <boost/random.hpp> //随机数
|
||
|
#include <boost/thread/thread.hpp>
|
||
|
#include <iostream>
|
||
|
#include <pcl/console/time.h> // TicToc
|
||
|
#include <pcl/features/normal_3d.h>
|
||
|
#include <pcl/filters/bilateral.h>
|
||
|
#include <pcl/filters/extract_indices.h>
|
||
|
#include <pcl/filters/fast_bilateral.h>
|
||
|
#include <pcl/filters/fast_bilateral_omp.h>
|
||
|
#include <pcl/filters/passthrough.h>
|
||
|
#include <pcl/filters/voxel_grid.h>
|
||
|
#include <pcl/io/pcd_io.h>
|
||
|
#include <pcl/io/ply_io.h>
|
||
|
#include <pcl/kdtree/kdtree.h>
|
||
|
#include <pcl/kdtree/kdtree_flann.h>
|
||
|
#include <pcl/point_cloud.h>
|
||
|
#include <pcl/point_types.h>
|
||
|
#include <pcl/registration/ia_fpcs.h> // 4PCS算法
|
||
|
#include <pcl/registration/ia_kfpcs.h> //K4PCS算法头文件
|
||
|
#include <pcl/registration/icp.h>
|
||
|
#include <pcl/registration/registration.h>
|
||
|
#include <pcl/search/flann_search.h>
|
||
|
#include <pcl/surface/concave_hull.h>
|
||
|
#include <pcl/surface/gp3.h> //贪婪投影三角化算法类定义的头文件
|
||
|
#include <pcl/surface/marching_cubes_hoppe.h> //移动立方体
|
||
|
#include <pcl/surface/marching_cubes_rbf.h>
|
||
|
#include <pcl/surface/mls.h> //MLS
|
||
|
#include <pcl/surface/poisson.h> //泊松重建
|
||
|
#include <pcl/visualization/cloud_viewer.h>
|
||
|
#include <pcl/visualization/pcl_visualizer.h>
|
||
|
#include <string>
|
||
|
#include <vector>
|
||
|
#include <vtkOutputWindow.h>
|
||
|
|
||
|
#include <pcl/console/time.h> // TicToc
|
||
|
#include <pcl/filters/approximate_voxel_grid.h> // 体素滤波
|
||
|
#include <pcl/filters/voxel_grid.h> // 体素滤波
|
||
|
#include <vtkOutputWindow.h>
|
||
|
|
||
|
#include <boost/thread/thread.hpp>
|
||
|
#include <pcl/ModelCoefficients.h>
|
||
|
#include <pcl/filters/extract_indices.h>
|
||
|
#include <pcl/io/pcd_io.h>
|
||
|
#include <pcl/point_types.h>
|
||
|
#include <pcl/sample_consensus/method_types.h> //随机参数估计方法
|
||
|
#include <pcl/sample_consensus/model_types.h> //模型定义
|
||
|
#include <pcl/segmentation/sac_segmentation.h> //RANSAC分割
|
||
|
#include <pcl/visualization/pcl_visualizer.h>
|
||
|
#include <sstream>
|
||
|
#include <stdlib.h> //rand()头文件
|
||
|
#include <vtkMassProperties.h>
|
||
|
#include <vtkPLYReader.h>
|
||
|
#include <vtkSmartPointer.h>
|
||
|
#include <vtkTriangleFilter.h>
|
||
|
|
||
|
#include <Eigen/Core>
|
||
|
#include <iostream>
|
||
|
#include <pcl/common/common.h>
|
||
|
#include <pcl/common/transforms.h>
|
||
|
#include <pcl/features/moment_of_inertia_estimation.h>
|
||
|
#include <pcl/filters/voxel_grid.h>
|
||
|
#include <pcl/io/io.h>
|
||
|
#include <pcl/io/pcd_io.h>
|
||
|
#include <pcl/io/vtk_io.h>
|
||
|
#include <pcl/io/vtk_lib_io.h>
|
||
|
#include <pcl/point_cloud.h>
|
||
|
#include <pcl/point_types.h>
|
||
|
#include <pcl/visualization/cloud_viewer.h>
|
||
|
#include <pcl/visualization/pcl_visualizer.h>
|
||
|
#include <string>
|
||
|
#include <string>
|
||
|
#include <vector>
|
||
|
#include <vtkAutoInit.h>
|
||
|
//可视化相关头文件
|
||
|
#include <vtkActor.h>
|
||
|
#include <vtkAutoInit.h>
|
||
|
#include <vtkInteractorStyleTrackballCamera.h>
|
||
|
#include <vtkPolyDataMapper.h>
|
||
|
#include <vtkProperty.h>
|
||
|
#include <vtkRenderWindow.h>
|
||
|
#include <vtkRenderWindowInteractor.h>
|
||
|
#include <vtkRenderer.h>
|
||
|
// Boost
|
||
|
#include <boost/math/special_functions/round.hpp>
|
||
|
|
||
|
// Visualization Toolkit (VTK)
|
||
|
#include <vtkRenderWindow.h>
|
||
|
|
||
|
#include "PointCloudOperatorAPI.h"
|
||
|
|
||
|
|
||
|
namespace PointCloudOperator {
|
||
|
|
||
|
class POINTCLOUDOPERATORAPI PointCloudMeshOperator:public QObject {
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
PointCloudMeshOperator(QObject* parent=nullptr);
|
||
|
~PointCloudMeshOperator()=default;
|
||
|
|
||
|
static bool GP(vtkSmartPointer<vtkPolyData>& inpolygon,
|
||
|
vtkSmartPointer<vtkPolyData>& polydata, double SearchRadius,
|
||
|
double Mu, int MaximumNearestNeighbors, double MaximumSurfaceAngle,
|
||
|
double MaximumAngle, double MinimumAngle);
|
||
|
|
||
|
static bool PoissonMesh(vtkSmartPointer<vtkPolyData>& inpolygon,
|
||
|
vtkSmartPointer<vtkPolyData>& polydata,
|
||
|
bool Confidence, size_t Degree,
|
||
|
size_t Depth, size_t IsoDivide, bool Manifold, bool OutputPolygons,
|
||
|
double SamplesPerNode, double Scale, size_t SolverDivide
|
||
|
);
|
||
|
|
||
|
|
||
|
static bool vtkPointSampling(vtkSmartPointer<vtkPolyData> surfaceMesh,vtkSmartPointer<vtkPolyData> uniformPointCloud,size_t pointCount,double radius);
|
||
|
};
|
||
|
|
||
|
} // namespace PointCloudOperator
|
||
|
|
||
|
#endif // LAMPCAE_POINTCLOUDMESH_H
|