blodow / realtime_urdf_filter

ROS package that can filter geometry defined in URDF models from Kinect depth images. Can also preprocess data for the OpenNI tracker, to remove backgrounds, robots etc.
Other
89 stars 46 forks source link

bug/twist in depth replacement condition? #2

Closed SebastianRiedel closed 8 years ago

SebastianRiedel commented 11 years ago

I think the replacement condition is twisted.

mintar commented 8 years ago

You're right that the replacement condition is twisted, but your solution doesn't work either:

bool should_filter = (sensor_depth - virtual_depth) > max_diff;

Take for example sensor_depth = 1.12, virtual_depth = 1.10 and max_diff = 0.05. The point should clearly be filtered out, but isn't according to that formula. Something like this should work:

bool should_filter = sensor_depth > (virtual_depth - max_diff);

Thanks to @JimmyDaSilva, who got it right in #3 (but also inverts the whole logic from should_filter to keep_point).

SebastianRiedel commented 8 years ago

@mintar for the record: If you look at our filter conditions as plain inequations and e.g. bring over the virtual_depth of my equation to max_diff’s side you’ll notice that the only difference between those formulas is the negative sign in front of max_diff :).

mintar commented 8 years ago

@SebastianRiedel I know. But that negative sign is important. :)

I just wrote the second formula that way because felt more intuitive than adding a negative sign to the first formula.

mintar commented 8 years ago

Can we close this PR, since it's now superseded by #8 and #9? (Not that it's going to get merged any time soon...)