-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 obtain all the color maps and depth maps from bag file with Python3? #8137
Comments
Hi @OldOG Your situation sounds similar to case #7932 In that Python case, the RealSense user - who is also processing depth and color frames from a bag - posted details of their solutions for reading the number of frames and for performance issues at #7932 (comment) |
Thanks for your help. I find two ways to convert the bag files to images. Firstly using the python script:
Secondly, use the convert tool:
I stil have two question:
|
OK I have found the answer: the convert tool drops the frames sometimes. |
Thanks very much @OldOG :) Do you require further assistance with this case, please? |
Case closed due to no further comments received. |
Hi @MartyG-RealSense , I have one more question: are the color maps obtained directly from bag files calibrated? Do I need to calibrate the frames manually? |
The infomation recorded in the bag will depend upon the calibration that the camera had at the time. If your camera has a healthy calibration then you should not need to perform any manual calibration on the images. You can perform a quick depth calibration of the camera with the On-Chip Calibration tool accessible from the More side-panel option of the RealSense Viewer, or a robust calibration of the camera with the SDK's Dynamic Calibration software tool (which includes RGB sensor calibration). |
So in other words, if I had never run the calibration software for the camera, the color maps are not calibrated? I get confused because I can read the distortion coefficients from the bag file. |
The depth and color sensors are calibrated in the factory as part of the manufacturing process, so typically RealSense cameras have a good calibration out of the box when new. There are factors that may affect calibration and necessitate a re-calibration to restore image quality though. These could include physical stresses such as a hard knock, drop on the ground or severe vibration. A high temperature event may also affect calibration, though a Thermal Compensation feature was introduced for the D455 camera model in SDK 2.43.0. The release notes state about this feature: "D455 introduces a compensation mechanism intended to mitigate the effect of thermal propagation in optics. When active (default = On) it will track and adjust Depth and RGB calibration parameters automatically". |
I get it. Thank you so much! 😄 |
good question! |
Issue Description
Hi, I'm trying to read frames from the bag file with python. I think there should be some APIs that support:
I need to process the frames one by one so I'd like to read them from the bag file one by one. Even though I have set the set_real_time to False, it seems most of the frames are dropped.
The following is my code:
The frame number is not the same as the file shows in the realsens-viewer. Also it's 15-second video but only around 100 frames are read.
I searched this problem and so surprisingly find that many people come up with the same issue. Could anyone help correct my code?
Or is there other ways to do this (like with matlab). I know there is a binary tool to convert bag file into jpeg images. But I need to bundle 3 realsense cameras so I don't know if the binary tool can offer the timestamp.
The text was updated successfully, but these errors were encountered: