First time here? Check out the FAQ!
answered 2019-04-22 04:57:43 -0600
you NEVER use new or delete here.
new
delete
Mat m(H,W,sometype);
will allocate data
m.release(); // called automatically at end of scope
will deallocate it