I want to save multiple images, but I found that the write name seems to be of const type and cannot be modified. How can I save multiple images and depth maps.
int i = 0;
sl::Mat image;
sl::Mat depth_image;
returned_state = zed.grab();
// A new image is available if grab() returns ERROR_CODE::SUCCESS
if (returned_state == ERROR_CODE::SUCCESS) {
// Get the left image
zed.retrieveImage(image, VIEW::LEFT);
zed.retrieveMeasure(depth_image, MEASURE::DEPTH);
_sleep(50);//延时50ms
// Display the image resolution and its acquisition timestamp
image.write("img1.png");
depth_image.write("depth1.png");
}
The Mat.write() method takes a const sl::String & type as input, not a const type.
You can set any sl::String value as an input to the method, and it will save the file at the correct path.
Hello, I am now able to save multiple images, but I find that later images do not overwrite the previous ones when I run them again. Can you tell me what went wrong?
::
while (i<10)
{
returned_state = zed.grab(runParameters);
// A new image is available if grab() returns ERROR_CODE::SUCCESS
if (returned_state == ERROR_CODE::SUCCESS) {