【问题标题】:Specify a Region for the pcl::PointCloud Data and Get the Available Points为 pcl::PointCloud 数据指定区域并获取可用点
【发布时间】:2020-06-21 21:28:24
【问题描述】:

我正在为 pcl::PointCloud 对象寻找一种方法或算法,它接受基于像素坐标的矩形甚至圆形区域,然后返回该区域中的所有可用点。

例如:

  1. 输入:100px
  2. 输出:XYZ 中的点

【问题讨论】:

    标签: c++ point-cloud-library


    【解决方案1】:

    对于像素级切片,只需在生成点云之前裁剪图像。例如在 OpenCV 中:

    cv::Rect myROI(100, 240, 20, 120); 
    cv::Mat croppedImage = image(myROI);
    

    如果您想在欧几里得坐标中对数据进行切片,可以使用PassThrough 过滤器:

    pcl::PassThrough<PointType> ptfilter (true); // Initializing with true will allow us to extract the removed indices
    ptfilter.setInputCloud (cloud_in);
    ptfilter.setFilterFieldName ("x");
    ptfilter.setFilterLimits (0.0, 1000.0);
    ptfilter.filter (*indices_x);
    

    如果您的原点周围是球形区域,请使用 Kdtree 对象中的 radiusSearch 方法并查询哪些点位于您的原点周围的半径内。

    【讨论】:

    • ptfilter.setFilterLimits (0.0, 1000.0) 的数量是多少?
    • 在此示例中,将保留 x 值为 0 到 1000 米的点
    • 我要指定像素而不是米!
    • 在这种情况下,只需在生成点云之前裁剪图像。例如在 OpenCV 中:cv::Rect myROI(100, 240, 20, 120); cv::Mat croppedImage = image(myROI);
    猜你喜欢
    • 1970-01-01
    • 2018-03-29
    • 1970-01-01
    • 2020-04-19
    • 2012-05-25
    • 2017-12-08
    • 1970-01-01
    • 2015-03-26
    • 1970-01-01
    相关资源
    最近更新 更多