How can I delete and free Mat from memory?
Mat rowPaddedImage(src.size(), CV_64F, Scalar(0, 0, 0));
copyMakeBorder(double_src, rowPaddedImage, 0, 0, left, right, BORDER_CONSTANT, value);
Mat rowPaddedImage(src.size(), CV_64F, Scalar(0, 0, 0));
copyMakeBorder(double_src, rowPaddedImage, 0, 0, left, right, BORDER_CONSTANT, value);
you NEVER use new
or delete
here.
Mat m(H,W,sometype);
will allocate data
m.release(); // called automatically at end of scope
will deallocate it
Asked: 2019-04-22 04:22:13 -0600
Seen: 2,380 times
Last updated: Apr 22 '19
delete nothing. Mat is a shared ptr : don't worry about memory management
Thank you!