ChNokI 돤룬휘 2021-08-19 15:48 采纳率: 0%
浏览 479
已结题

PCL1.12+VS2019操作点云过程中memory.h触发断点如何解决?

本人使用了PCL1.12以及VS2019进行点云操作编程,但是在运行过程中发现程序无法正常运行或退出,会蹦出memory.h 中我的exe触发了一个断点的提示,如图。

img
可能有问题的代码如下:

想请问解决办法。即使跑官方例程也会有这样的问题。
代码会在运行完cout<<"1"<<endl;后蹦出断点提示,for循环只运行了一次。如果把后面三角化的代码块去掉则程序会把for循环运行完,但是最终也会蹦出断点提示,程序会非正常退出。

    pcl::PointCloud<pcl::PointXYZ> cloud_filtered;
    pcl::PointCloud<pcl::PointXYZ> cloud_downSp;
    pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> n;
    pcl::PointCloud<pcl::Normal> normals;
    pcl::search::KdTree<pcl::PointXYZ>::Ptr tree(new pcl::search::KdTree<pcl::PointXYZ>);
    pcl::PointCloud<pcl::PointNormal> cloud_with_normals;
    pcl::search::KdTree<pcl::PointNormal>::Ptr tree2(new pcl::search::KdTree<pcl::PointNormal>);
    pcl::PolygonMesh triangle;
    vector<pcl::PolygonMesh> triangleSeries;
    for (int i = 0; i < cloudSeries.size(); i++) {
        //Deal with the cloudSeries[i] seperetely.
        cloudPointNum.push_back(cloudSeries[i].size());

        //1st, Filtering the outliner points.
        cout << "Filtering " << i << " cloud outliner points." << endl;
        pcl::StatisticalOutlierRemoval<pcl::PointXYZ> outliner;
        outliner.setInputCloud(cloudSeries[i].makeShared());
        outliner.setMeanK(50);
        outliner.setStddevMulThresh(1.0);
        outliner.filter(cloud_filtered);
        
        cout << "Down sampling " << i << " cloud points." << endl;
        pcl::VoxelGrid<pcl::PointXYZ> DownSp;
        DownSp.setInputCloud(cloud_filtered.makeShared());
        DownSp.setLeafSize(0.15f, 0.15f, 0.15f);
        DownSp.filter(cloud_downSp);
        cloud_filtered.clear();
        
        cout << "Cal normals." << endl;
        tree->setInputCloud(cloud_downSp.makeShared());
        n.setInputCloud(cloud_downSp.makeShared());
        n.setSearchMethod(tree);
        n.setKSearch(20);
        n.compute(normals);

        pcl::concatenateFields(cloud_downSp, normals, cloud_with_normals);
        cloud_downSp.clear();
        normals.clear();
        
        cout << "Triangling." << endl;
        tree2->setInputCloud(cloud_with_normals.makeShared());
        pcl::GreedyProjectionTriangulation<pcl::PointNormal> gp3;
        gp3.setSearchRadius(0.03);
        gp3.setMu(2.5);
        gp3.setMaximumNearestNeighbors(100);
        gp3.setMaximumSurfaceAngle(M_PI / 4);
        gp3.setMinimumAngle(M_PI / 18);
        gp3.setMaximumAngle(2 * M_PI / 3);
        gp3.setNormalConsistency(false);

        gp3.setInputCloud(cloud_with_normals.makeShared());
        gp3.setSearchMethod(tree2);
        gp3.reconstruct(triangle);
        
        triangleSeries.push_back(triangle);
        cloud_with_normals.clear();
        cout << "1" << endl;
        
    }


  • 写回答

1条回答 默认 最新

  • 有问必答小助手 2021-08-20 19:56
    关注

    你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答


    本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。


    因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。

    评论

报告相同问题?

问题事件

  • 系统已结题 8月27日
  • 修改了问题 8月19日
  • 创建了问题 8月19日

悬赏问题

  • ¥15 汇编语言没有主程序吗?
  • ¥15 这个函数为什么会爆内存
  • ¥15 无法装系统,grub成了顽固拦路虎
  • ¥15 springboot aop 应用启动异常
  • ¥15 matlab有关债券凸性久期的代码
  • ¥15 lvgl v8.2定时器提前到来
  • ¥15 qtcp 发送数据时偶尔会遇到发送数据失败?用的MSVC编译器(标签-qt|关键词-tcp)
  • ¥15 cam_lidar_calibration报错
  • ¥15 拓扑学,凸集,紧集。。
  • ¥15 如何扩大AIS数据容量