-
Notifications
You must be signed in to change notification settings - Fork 173
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
Quantile filtering new #82
base: ros2
Are you sure you want to change the base?
Conversation
…rameter to specify which quantile value to use. Updated test.
…he current behavior of using the minimum value in each row.
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 |
Hello @clalancette , |
Hey @chadrockey :) |
@@ -69,13 +71,19 @@ class DEPTHIMAGETOLASERSCAN_EXPORT DepthImageToLaserScan final | |||
* radii for each angular increment. The output scan will output the closest radius that is | |||
* still not smaller than range_min. This can be used to vertically compress obstacles into | |||
* a single LaserScan. | |||
* @param quantile_value The quantile value to use for calculating the distance for each column. | |||
* This value determines which distance measurement to use from the multiple | |||
* rows of depth data. For example, a quantile value of 0.1 will use the 10th |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel the second sentence says the same information as the introduction but in a less direct way. A column is a more conceptually clear concept and is the standard language.
Thanks for the detailled answer! Regarding the low performance computation, I would have to run some tests to see how it is affected by the more complex calculation.
To get a median filter, we just have to set the quantile value to I never thought about using a bilateral filter for this usecase, but as long as each column gets filtered individually (meaning we would apply 1D bilateral filter to each column) I don't think there would be any benefit, as we don't have to preserve vertical edges (along each column) for the laserscan message. But it could make sense to apply a 2D bilateral filter to the complete depthimage before performing the depthimage_to_laserscan step (with using the current column-minimum or the proposed column-quantile approach). However in that case maybe it would make sense to perform the bilateral filtering of the depthimage in a prior separate step outside of this package. One can still filter in the horizontal direction, over multiple columns/scan-ranges. I currently do this using laser_filters after the depthimage_to_laserscan step. I maily use a spatial median filter see this PR for the laserscan message. Here a 1D bilateral filter (this time in the horizontal direction) would make sense in my opinion.
This is also an interesting idea. We could use a moving window approach to use a ROI for each column that includes the neighboring columns around the current one (this way we would have overlapping ROIs). Another option would be to split the set of columns into non-overlapping chunks, which would lead to a lower output-resolution of the laserscan (number of columns divided by the chunksize). For both options the size of the set of pixels for which the quantile has to be calculated would increase (by a factor of the number of columns in each row). This will lead to increased computational load because a larger set of pixels has to be sorted each time. In my opinion using a ROI here would (probably) not have any benefits over using two separate steps (1. depthimage_to_laserscan, 2. laser_filters) while leading to increased computational load and making this package more complex.
Yes. A value of
This is something I did not know of at all. So even if the filtered scans do look cleaner, it might actually be decremental to the performance of things like AMCL because they expect data with a certain kind of noise distribution?
I this does not mean that I would be the only maintainer, I would be interested in that. I am not even close to beeing an expert in ROS by any means but I do plan to get more into it and keep working with it in the future. This package (or a new "depthimage to laserscan pro" package) could be a good start into getting more in touch with the ecosystem (e.g. things like the build farm which I did not touch at all until now).
Because you said this package is intended to be a simple and low performance computation solution, I do agree that it should not be bloated with more complex stuff that many new uses don't need or can't run on low-end hardware. |
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.0.0
will have the effect of using the minimum value of each column (the current behavior and default value).0.5
will use the median of each column.quantile_value
of around0.1
. This way a lot of noise/outliers was removed, but the laserscan data still contained obstacles, even if they only covered a small part (>10%) of thescan_height
.