Memory Leak in Mat::copyTo()
I have a vector of images (called images) in OpenCV 3.0.0, which I iterate through in the way shown below. Please disregard, that this code makes no actual sense, I stripped it to point out the problem. Strangely, with each run the memory usage increases, even after the loop has completed. The way I see it, memory should stay the same, since the images in the images-vector are replaced. Manually releasing the matrices does not work either. What can I do to achieve constant memory usage.
for (int i = 0; i < num_images; ++i)
{
Mat cropped_image;
images[i].copyTo(cropped_image);
images[i] = cropped_image;
}
can't reproduce it on win - constant mem usage here.
This results in a memory leak if one is a UMat and the other is a Mat. I ran into this problem and posted a question with some additional memory diagnostics from VS 2015 here. http://answers.opencv.org/question/78...