天天看点

基于Open3D的点云体素滤波及显示

基于c++ Open3D的点云体素滤波及显示

#include <string>
#include <Eigen>  //Eigen库
#include <Open3D/Open3D.h>
using namespace open3d;
using namespace std;
int main(int argc, char* argv[]) {

    //读取点云
    std::shared_ptr<geometry::PointCloud> cloud(new geometry::PointCloud);
    open3d::io::ReadPointCloud("C:/Users/a/Desktop/1.ply", *cloud);
    auto cloud1 = cloud->VoxelDownSample(3.0);

    cloud1->PaintUniformColor({ 1, 0, 0 });
    open3d::visualization::DrawGeometries({cloud1}, "visualization", 960, 900, 960, 100);
    return 0;
}
           

继续阅读