pcl
pcl copied to clipboard
[segmentation] "Retrieve differences OR similarities between two point clouds with pcl::SegmentDifferences::segment"
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:

The new line would be something like
if ((nn_distances[0] > threshold && !getSimiliarInsteadFlag) || (nn_distances[0] < threshold && getSimiliarInsteadFlag))
Thank you!
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 @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