[pdal] PCLBlock drops non-XYZ dimensions & what to do about

Bradley Chambers brad.chambers at gmail.com
Wed Mar 15 05:56:05 PDT 2017


Michael,

Also, if you take a peek at the PCL plugin prior to our refactor (proposed
[1] and implemented [2]), you'll see some good examples of doing exactly
what you propose wrt extracting indices in many of the filters, for example
[3] and [4].

Brad

[1] https://github.com/PDAL/PDAL/issues/1404
[2] https://github.com/PDAL/PDAL/pull/1432
[3]
https://github.com/PDAL/PDAL/blob/006ea71362a5486109f48d2981b72ada15b31916/plugins/pcl/filters/DartSampleFilter.cpp#L84-L98
[4]
https://github.com/PDAL/PDAL/blob/d32c77f37007a494ce88e1e9ca64a14a6b21892f/plugins/pcl/filters/GroundFilter.cpp#L99-L161



On Tue, Mar 14, 2017 at 8:53 PM Bradley Chambers <brad.chambers at gmail.com>
wrote:

> Michael,
>
> You are correct that there is no out of the box LAS point type, although
> you could in theory create one [1].
>
> Various PCL modules provide methods such as "getInliers" to get a vector
> of indices [2]. PCL treatment of inliers varies somewhat from module to
> module, so one has to read the docs carefully.
>
> For an example of acting on the indices, you can look at the OutlierFilter
> where we start by processing a PointView to obtain (in this case) two
> vectors of PointIds, the inliers and the outliers [3]. We later create a
> new output PointView by appending only the inliers from the input PointView
> [4].
>
> No need to sort. The PDAL to PCL conversion [5] is order preserving, so
> unless your PCL code is doing something to the order, you should be good.
>
> Brad
>
> [1]
> http://pointclouds.org/documentation/tutorials/adding_custom_ptype.php#how-to-add-a-new-pointt-type
> [2] http://docs.pointclouds.org/1.7.1/classpcl_1_1_sample_consensus.html
> [3]
> https://github.com/PDAL/PDAL/blob/master/filters/OutlierFilter.cpp#L159
> [4]
> https://github.com/PDAL/PDAL/blob/master/filters/OutlierFilter.cpp#L203-L209
> [5]
> https://github.com/PDAL/PDAL/blob/master/plugins/pcl/PCLConversions.hpp#L127-L191
>
>
> On Tue, Mar 14, 2017 at 6:27 PM Michael Rosen <michael.rosen at gmail.com>
> wrote:
>
> Picking up on a conversation started on Gitter:
> https://gitter.im/PDAL/PDAL
>
> One problem we have with the PCLBlock filter is that we currently drop all
> non-XYZ dimensions because when we marshal point cloud data from PDAL -->
> PCL we needs to specify a PCL-compatible point type and we pick XYZ.  As a
> result, when we marshal the result back, we there is nothing except XYZ.
>
> One workaround suggested was to create a PCL point type that fits the
> data.  My quick look suggests there is not such point type, even for the
> simplest of LAS files.  Can someone confirm this?  These, I think, are the
> options http://docs.pointclouds.org/1.5.1/point__types_8hpp_source.html ?
> So, For example, no way to carry Classification to say nothing of LAS
> metadata like the array of "Number of points by return."
>
> The other suggestion was to return just the indices of the desired
> points.  Can someone say a little more about what PCL API would enable
> this?  Once we had it, how can we get PDAL to remove all the points except
> those returned?
>
> One thought I had would be to sort the point cloud before marshaling it to
> PCL and similarly sort the result from PCL.  Create the desired result set
> by marching through the point clouds in parallel removing anything from the
> original point cloud that isn't in the PCL result.
>
>
>
> msr
> _______________________________________________
> pdal mailing list
> pdal at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/pdal
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20170315/bcf2ec96/attachment.html>


More information about the pdal mailing list