Question

I have a city square with people, cars, trees and buildings in pcl format. I need to automatically determine the ground plane and project this objects on that ground plane to get a 2D map with occupied places.

Any idea?

Was it helpful?

Solution

I think the best thing to do here would be to familiarise yourself with the following two PCL tutorials:

http://pointclouds.org/documentation/tutorials/planar_segmentation.php

http://pointclouds.org/documentation/tutorials/project_inliers.php

The first tutorial makes use of the RANSAC algorithm to find a dominant plane in a scene. I use it to find tables and floors in robotics scenarios. You would use it to find your dominant ground plane.

The second tutorial shows how to project points directly onto a plane. This is what you would use to make your 3D point cloud into a 2D one. Note that, despite the "inlier" keyword, you can pass your whole point cloud to be projected onto the plane.

Actually, if you are after "occupied" places, you might want to project all of the points that aren't in the ground plane (i.e. the outliers), and that are above it (you can use a PCL filter, such as PlaneClipper3D, for example, or just the complement of the outliers from the plane-segmentation operation.

If the plane that you end up with (containing all your projected points) is not in the coordinate frame you want, you may wish to rotate the whole lot, for example, to align with the coordinate axes so that all z-coordinates are zero. See pcl::transformPointCloud for this (the transform will be obtainable from the plane coefficients returned from the plane segmentation).

I hope this is helpful and not at too basic a level, though the question was rather general so I suppose it should be okay.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top