ros-perception / depthimage_to_laserscan

Converts a depth image to a laser scan for use with navigation and localization.
257 stars 172 forks source link

Quantile filtering new #82

Open YBachmann opened 3 months ago

YBachmann commented 3 months ago

Currently the minimum value of each column in the depthimage was used to calculate the distance values.

When dealing with noisy data it is benefitial to use e.g. the 10% quantile instead of the minimum value. This way we still get accurate data but ignore noise/outliers.

The parameter quantile_value controls which quantile should be used.

YBachmann commented 3 months ago

Hello @clalancette ,

could you please take a look at this PR?

I attached a small video showing a comparison of the current state of using the minimum value in each column (orange) and my proposed approach of using quantiles/percentiles (purple). In this test a scan_height of 180 pixels was used and for my version a quantile_value of 0.35. In my opinion using a quantile instead of the minimum of a row greatly reduces noise and more accurately reflects the position of obstacles/walls. It is also easily adjustable. If you have very little noise or want to detect small objects that might only take up a couple pixels in each row, you can set the quantile_value parameter to a small numer (or even to 0.0 to retain the current behavior). If you want smooth and accurate laserscans and only care about larger objects you can set the value to something bigger. depthimage_to_laserscan_quantile_comparison.webm

YBachmann commented 1 month ago

Hello @clalancette , as some time passed, I just wanted to check in if you had any chance to take a look at this PR? If not, are there maybe other maintainers that you could refer this to? Or is this functionality just not wanted? In any case, I would be happy for a response. Kind regards, Yannic