EADST

C++: Delete Uchar Variable after Assigned Mat Data

The memory needs to be released. But the uchar variable cannot be deleted directly after assigned. Here is the code.

Mat new_img = Mat::ones(2, 2, CV_8UC3);
uchar *img_array = new uchar[new_img.rows*new_img.cols];
img_array = new_img.data;
img_array = NULL;
delete[] img_array;
相关标签
C++
About Me
XD
Goals determine what you are going to be.
Category
标签云
站点统计

本站现有博文266篇,共被浏览440747

本站已经建立2019天!

热门文章
文章归档
回到顶部