Save Images to disk from a vector of images #11734
-
Hello, I have the following code:
My idea was to capture 100 frames and save them into two vectors. After the 100 frames there is a second for loop for saving the images from two vectors of the left and right stream. But this is not working! As you can see in the second for loop I have cv::imshow("left", left_images[a]); So I can see what is actually been saved. To my surprise not the images from the first for loop where saved, but actual frames of my D405 are showed to me and saved, but I´m not in the first for loop where the images from my D405 are recieved. I am in the second for loop and just want to show and save my images, which where recieved in the first for loop. Can anyone explain this to me? Another strange behaviour is, that in the second for loop the left and right images where mixed. Means that I have images which belongs to the right imager, and they where saved as left image. The left images where saved in the following way: two frames from the left imager, two frames of the right imager, two frames of the left, then two frames of the right and so on, with ascending numeration. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@HanzDieter Hi,
This means that when you loop you drop the frames managed by the SDK.
Good luck |
Beta Was this translation helpful? Give feedback.
@HanzDieter Hi,
According to cv::Mat docs
This means that when you loop you drop the frames managed by the SDK.
The SDK see its out of scope so he releases this memory.
You have 2 options:
keep
method.this will tell the SDK not to free this memory
Good luck