pcl icon indicating copy to clipboard operation
pcl copied to clipboard

[segmentation] "Retrieve differences OR similarities between two point clouds with pcl::SegmentDifferences::segment"

Open tomcat327 opened this issue 4 years ago • 2 comments

Hello, very easy feature request here, but I'm a person very new to C++ and PCL as well.

Currently, pcl::SegmentDifferences::segment is able to return the portion of the "src" point cloud that differs from the "target" point cloud. I would like there to be an option with this to return the portion of the "src" point cloud that is similar to the "target" point cloud.

I believe that besides adding a boolean for the user to set that determines whether we're doing difference or similar, the only line that would need to change is this one: image

The new line would be something like if ((nn_distances[0] > threshold && !getSimiliarInsteadFlag) || (nn_distances[0] < threshold && getSimiliarInsteadFlag))

Thank you!

tomcat327 avatar Oct 20 '21 15:10 tomcat327

We maintainers likely don't have the time right now to work on this, but you are of course welcome to do so and submit a pull request. Just a hint though, the class CorrespondenceEstimation in the registration module does approximately what you are describing

mvieth avatar Oct 22 '21 12:10 mvieth

@mvieth @tomcat327 Although this issue has been pending for a long time, here are 2 possible solutions

  • provide a new interface that returns similar and difference point clouds
  • also return difference indexes, and leave the rest to the user

daohu527 avatar Sep 01 '23 13:09 daohu527