Closed SebastianRiedel closed 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).
@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 :).
@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.
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...)
I think the replacement condition is twisted.