Skip to content
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

How to extract raw stereo images(left and right camera images) from database created by Rtabmap. #1449

Open
skitmanish opened this issue Feb 10, 2025 · 4 comments

Comments

@skitmanish
Copy link

skitmanish commented Feb 10, 2025

Could you please let me know if the RTAB-Map database has a specific field that stores the left and right camera images from the stereo setup? If so, what is the field name, and how can it be accessed?

Thanks!

@matlabbe
Copy link
Member

You can use rtabmap-databaseViewer and do File -> Extract images...

You can also use rtabmap-export --images rtabmap.db.

If you want to extract yourself from the database, they are compressed blob that can be decoded by opencv's imdecode function:

image BLOB, -- compressed image (Grayscale or RGB)
depth BLOB, -- compressed image (Depth or Right image)

(depth is the right image in a stereo config)

@skitmanish
Copy link
Author

Hi, thank you for the quick response!

I have another question:

I am running Rtabmap with local stereo images and want to store the exact same images I provided as input. I used the Data Recorder tool to store raw data, but I noticed that the right images in the exported database are grayscale and resized based on the provided decimation. I need the images to be stored in their original size and in color. Is there a way to achieve this?

@matlabbe
Copy link
Member

matlabbe commented Mar 1, 2025

Don't provide decimation to keep same resolution. To keep the right image as rgb, you may have to hard-code the output encoding here to bgr8 instead of mono8:
https://github.com/introlab/rtabmap_ros/blob/a57b2971f2079d375f867bdb6927efefd75ddd38/rtabmap_conversions/src/MsgConversion.cpp#L2494
However, I am not totally sure at 100% that it would not cause any issue.

@matlabbe
Copy link
Member

matlabbe commented Mar 9, 2025

Added a PR to support right color image downstream: #1463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants