ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Assumin 8UC3 rgb image, and 16UC1 deph image, this is what I use for saving and loading:
// save images
cv::imwrite("rgb.png", rgb_img);
cv::imwrite("depth.png", depth_img);
// load images
rgb_img = cv::imread("rgb.png");
depth_img = cv::imread("depth.png", -1);
I believe the crucial part is the -1 flag. From the imread page:
flags: <0 Return the loaded image as is (with alpha channel).
2 | No.2 Revision |
Assumin Assuming 8UC3 rgb image, and 16UC1 deph image, this is what I use for saving and loading:
// save images
cv::imwrite("rgb.png", rgb_img);
cv::imwrite("depth.png", depth_img);
// load images
rgb_img = cv::imread("rgb.png");
depth_img = cv::imread("depth.png", -1);
I believe the crucial part is the -1 flag. From the imread page:
flags: <0 Return the loaded image as is (with alpha channel).
3 | No.3 Revision |
Assuming 8UC3 rgb image, and 16UC1 deph depth image, this is what I use for saving and loading:
// save images
cv::imwrite("rgb.png", rgb_img);
cv::imwrite("depth.png", depth_img);
// load images
rgb_img = cv::imread("rgb.png");
depth_img = cv::imread("depth.png", -1);
I believe the crucial part is the -1 flag. From the imread page:
flags: <0 Return the loaded image as is (with alpha channel).