Skip to content

Save Images to disk from a vector of images #11734

Answered by Nir-Az
HanzDieter asked this question in Q&A
Discussion options

You must be logged in to vote

@HanzDieter Hi,
According to cv::Mat docs

data. Matrix constructors that take data and step parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied

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:

  1. explicitaly copy the frames from the SDK
  2. Use other SDK API that has the keep method.
    this will tell the SDK not to free this memory

Good luck

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@HanzDieter
Comment options

Answer selected by HanzDieter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants