Saving image as png using imwrite
-
Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):
- Consider checking out SDK examples.
- Have you looked in our documentations?
- Is you question a frequently asked one?
- Try searching our GitHub Issues (open and closed) for a similar issue.
-
All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)
| Required Info | |
|---|---|
| Camera Model | D435i |
| Firmware Version | (Open RealSense Viewer --> Click info) |
| Operating System & Version | Win10 |
| Kernel Version (Linux Only) | (e.g. 4.14.13) |
| Platform | PC. |
| SDK Version | { legacy / 2.>.> } |
| Language | {opencv } |
| Segment | {Robot/Smartphone/VR/AR/others } |
Issue Description
<Describe your issue / question / feature request / etc..> I am trying to save image streams and IMU using callback function. I am using threads with a blocking queue to save data without any loss. So when push data into queue there is a lock and pop from queue there is a lock too.
Interestingly, some of color images I got look like

Some of them is good but I got weird images(above case there is unsynched area at the line) such like that when I saved data while moving.
Is there any suggestion? p.s. In the recorded Ros bag using viewer, there are no results like that.
I haven't worked with the IMU and not sure what language you are working in, but #4934 has code to save the color frames as .png, depth as matrices, and to not have frame drops.
You can save depth frames as 16-bit png. Here is C++ code:
std::vector<int> compression_params;
compression_params.push_back(CV_IMWRITE_PNG_COMPRESSION);
compression_params.push_back(0); // lossless, the number is 0-9, the most data will be lost at 9 (lightest), none at 0 (heaviest)
std::string dateTime;
timeStamp(dateTime, "");
cv::imwrite(dateTime + ".png", image_full, compression_params); // save filename as date
Hi @hojunson Do you have further question on this?
No. Closing is fine Thanks.
2019년 10월 28일 (월) 오후 11:19, RealSense Customer Support < [email protected]>님이 작성:
Hi @hojunson https://github.com/hojunson Do you have further question on this?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IntelRealSense/librealsense/issues/4982?email_source=notifications&email_token=AFY4LCJYMLH23FFI4TSN44TQQ6TU3A5CNFSM4I5WLUEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECPDEYQ#issuecomment-547238498, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFY4LCMD6JZ533LNGD2NNLLQQ6TU3ANCNFSM4I5WLUEA .