Apply a minimum distance filter to depth images

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Apply a minimum distance filter to depth images

alsozatch
Hello, this is my first time posting here. Apologies if I'm doing something wrong.

I'm using rtabmap_ros hooked up to depth images from a ZEDX camera (/zed/zed_node/depth/depth_registered). I need to filter the depth image to cut out anything too close to the camera. Is there a way to apply that filter as a parameter to RTABMAP? I'm looking through rtabmap.launch.py and I do not see it.

The zed ros wrapper itself has a parameter for filtering depth distance, but for some reason it appears to be software limited to 3.0 meters (I need to do filtering greater than that). This can probably be addressed by editing source code but I'd rather avoid that.
Reply | Threaded
Open this post in threaded view
|

Re: Apply a minimum distance filter to depth images

matlabbe
Administrator
Hi,

There are many places you can filter the depth for different reasons:

* For the occupancy grid, you can use Grid/RangeMin parameter.

* For features extraction, you can use Kp/MinDepth and Vis/MinDepth parameters.

* For 3D point clouds visualization, there is a min depth parameters in 3D Rendering settings of rtabmap_viz and also a similar parameter under rviz's rtabmap_rviz_plugins/MapCloud plugin.

* When exporting the point clouds, there is also a minimum depth parameter.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Apply a minimum distance filter to depth images

alsozatch
This post was updated on .
Thanks. Basically there is a big arm in front of the cameras, and its position is not necessarily known. So I need to cut out of the depth map for basically all parts of rtabmap, importantly both feature extraction (the arm might be in a different position when the scene would otherwise have loop closure) and in visualization (don't want arm appearing in the stitched point cloud).

Currently I have nodes re-publishing filtered depth. It sounds like instead of that I can just use Kp/MinDepth, Vis/MinDepth and depth parameters for visualization.

I am recording .db files and then loading them up locally because I do not have the bandwidth to view rtabmap runs live from the remote robot. However when I want to do re-mapping in post, I seem to be missing something. Of the 3 image views on the left, the middle remains black. I think it should usually be for showing feature matches/loop closures. The way I use rtabmap viz is "New Database" and selecting source from the .db. I can hit play and a map starts to build, but it looks like it is only using imu. If I specify the min depth parameter in viz, that does successfully apply when re-mapping. Do you know why I'm not getting the typical behaviour in the 2nd image view on the left column?

Edit: Actually, loop closures do still appear. That particular recording just didn't have loop closures for a long time.
Reply | Threaded
Open this post in threaded view
|

Re: Apply a minimum distance filter to depth images

matlabbe
Administrator
By filtered depth image, do you mean the arm is filtered from the depth image? If so, you may not have to change any settings on rtabmap side, just feed your filtered depth instead of the original one.

The second image view of the loop closure detection panel would show something only on loop closures (unless in General Settings you enabled "Show the image of the highest hypothesis").

I can hit play and a map starts to build, but it looks like it is only using imu
"only using imu", for the pose? When selecting database as input source, normally it would use the original odometry saved in the database (doesn't recompute it).