Say I have an allocated cv::Mat img
of size 100x100. Now I call img.create(50,50,img.type())
.
Since the type is the same, there is, obviously, enough memory already allocated, and all that's needed is to set a proper "ROI" on the existing Mat
.
Does create()
actually do this, or does it release and re-allocate since the size is different (50x50 vs. 100x100)?