Based on my humble understanding, OpenCV's Mat handles the memory management efficiently; so copying Mats does not mean they are "hard/physically" copied; they just refer to the original Mat.
However, for mats that has been pushed into a larger Mat using push_back, is it safe to clear them assuming that they were hard copied, not using same technique of copying like in x=y
?
In the following code, does bigx
still has x
's contents even after releasing the latter?
Mat x, bigx;
bigx.push_back(x);
x.release();
thank you :)