Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

voxelGrid filter in PCL 1.8.1 produces slightly different coordinates than in PCL 1.7.2 #2375

Closed
philRudd69 opened this issue Jul 12, 2018 · 4 comments

Comments

@philRudd69
Copy link

philRudd69 commented Jul 12, 2018

Your Environment

  • Operating System and version: Linux Ubuntu 14.04 LTS
  • Compiler: catkin 0.6.19 using g++-4.8 or just g++-4.8 respectively
  • PCL Version: 1.7.2 with "ros-indigo-pcl-ros" and 1.8.1 as 'standalone' version build from the PCL git repository, respectively. I built it approx. 3 months ago.

Context

I'm loading .ply and .pcd files and apply the voxelGrid filter onto them. Doing simple downsampling. Both PCL versions should yield the same downsampled point clouds.

Expected Behavior

The filter should behave the same in both PCL versions, i.e. resulting in the same points.

Current Behavior

I filtered the same point cloud with both PCL versions, but some of the resulting points differ in their x,y,z-coordinates. The differences are somewhat small. When visualizing both downsampled point clouds within the same pcl_viewer, i.e. overlaying them, one can not really see the difference. (see screenshot of the result in my git repository)

Code to Reproduce

You need a system with ROS Indigo. And PCL 1.8.1 installed as 'standalone' on the same system as well. Such that you can use both: ROS_PCL and PCL 1.8
Then follow the steps from the following repos, I created specifically for this bug report:
https://github.com/philRudd69/voxelGrid_filter_PCL_1.8
https://github.com/philRudd69/voxelGrid_filter_PCL_1.7

Possible Solution

@taketwo
Copy link
Member

taketwo commented Jul 12, 2018

The library evolves and the implementations change. There is no guarantee or commitment that different versions should output exactly the same values.

You admit that the differences are "somewhat small". Why does this bother you then?

@philRudd69
Copy link
Author

philRudd69 commented Jul 13, 2018

There is no guarantee or commitment that different versions should output exactly the same values.

Thanks, that's good to know. I looked through the change-log, and did not find anything on the voxel grid filter - though I might have overlooked something - and thought that this change in behaviour might be unintended. So I posted this here :)

You admit that the differences are "somewhat small"

Well relatively speaking. It seems to be in the area of 1*10^-6... but it is enough, that the code of my project behaves significantly different. Btw: You can check out the point coordinates, I uploaded the filtered clouds in those repos.

Why does this bother you then?

Since you asked: For my masters thesis I am extending an existing code-framework, which originally uses ROS indigo with PCL 1.7.2, and part of its function is to downsample pointclouds. Subsequently, the downsampled cloud's diameter is approximated, and used for an object detection algorithm. Now, for my extensions of the original code, I'd like to use the CUDA support of PCL 1.8.1. But switching to 1.8.1 causes slightly different downsampling results, which in turn lead to slightly different cloud diameters. Furthermore, the slight differences in the point coordinates don't only influence the cloud diameter, but also cause differing quantization-results when I quantize the distance between two points in distinct steps. All in all, those differences yield significantly different recognition rates. :-/
I'd like to compare my results with my enhanced algorithm directly with those of the original algorithm. So I need the exact same downsampling-behaviour for both PCL versions. Certainly there are ways around this problem, like switching everything to the same PCL version, but that's off topic. :)

@philRudd69 philRudd69 changed the title voxelGrid filter in PCL 1.8.1 produces different z-coordinates than in PCL 1.7 voxelGrid filter in PCL 1.8.1 produces slightly different coordinates than in PCL 1.7 Jul 13, 2018
@philRudd69 philRudd69 changed the title voxelGrid filter in PCL 1.8.1 produces slightly different coordinates than in PCL 1.7 voxelGrid filter in PCL 1.8.1 produces slightly different coordinates than in PCL 1.7.2 Jul 13, 2018
@taketwo
Copy link
Member

taketwo commented Jul 16, 2018

Well relatively speaking. It seems to be in the area of 1*10^-6... but it is enough, that the code of my project behaves significantly different.

I'd say it's a pretty bad sign if variations on the level of machine precision cause the behavior of your code to deviate significantly.

I'd like to use the CUDA support of PCL 1.8.1. But switching to 1.8.1 causes slightly different downsampling results

I might be wrong, but I think there were no significant new additions to CUDA support for a very long while. Are you sure 1.7.2 does not provide the functions you need?

I'd like to compare my results with my enhanced algorithm directly with those of the original algorithm.

I think it's absolutely fair to compare to the results that the original algorithm outputs now, with slightly different downsampling. So I wouldn't be too much concerned about reproducing the exact recognition rate the authors reported. (What if they had a randomized algorithm and through excessive experimentation found a seed that gives a high recognition rate on a particular dataset? You don't have to use that same seed!)

@taketwo
Copy link
Member

taketwo commented Aug 31, 2018

Closing this since we are not going to revert VoxelGrid changes.

@taketwo taketwo closed this as completed Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants