CISC849:
Robot Vision & Learning
Prof. Christopher Rasmussen
September 5, 2019
Ground Segmentation
Ground Segmentation
Ground Segmentation
Ground Segmentation
One dominant plane
Important planes
Important planes
Walking task
Perceptual needs: Walking
Walking: DRC-Hubo ladar point cloud (zigzag detail)
Walking: DRC-Hubo ladar point cloud (ramp, zigzag, steps)
Debris task
Perceptual needs: Debris
Hose task: DRC-Hubo view from one camera -- less planes!
Multiple large planes
Ground Segmentation
Robust Plane Fitting
Robust Plane Fitting
RANSAC plane fitting
RANSAC plane fitting
RANSAC plane fitting
RANSAC plane fitting
RANSAC plane fitting
RANSAC plane fitting
RANSAC plane fitting
RANSAC in
RANSAC in PCL
#include <iostream>�#include <pcl/ModelCoefficients.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>��int main (int argc, char** argv)�{� pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);�� // Fill in the cloud data…
// ???�� // Try to do robust plane fit� pcl::ModelCoefficients::Ptr coefficients (new pcl::ModelCoefficients);� pcl::PointIndices::Ptr inliers (new pcl::PointIndices);� pcl::SACSegmentation<pcl::PointXYZ> seg; // Create segmentation object�� seg.setOptimizeCoefficients (true); // optional
seg.setModelType (pcl::SACMODEL_PLANE); // mandatory� seg.setMethodType (pcl::SAC_RANSAC);� seg.setDistanceThreshold (0.01); // 1 cm�� seg.setInputCloud (cloud);� seg.segment (*inliers, *coefficients);�
� // did it work?
� if (inliers->indices.size () == 0) {� PCL_ERROR ("Could not estimate a planar model for the given dataset.");� return (-1);� }�
// report results
std::cerr << "Model coefficients: "
<< coefficients->values[0] << " " � << coefficients->values[1] << " "� << coefficients->values[2] << " " � << coefficients->values[3] << std::endl;�� std::cerr << "Model inliers: " << inliers->indices.size () << std::endl;� for (size_t i = 0; i < inliers->indices.size (); ++i)� std::cerr << inliers->indices[i] << " "
<< cloud->points[inliers->indices[i]].x << " "� << cloud->points[inliers->indices[i]].y << " "� << cloud->points[inliers->indices[i]].z <<
std::endl;
return (0);�}