Cv :: Mat.refcount Not available in OpenCV 3.0

In OpenCV 2.4.9, the following works:

cv::Mat TestMat(3,3,CV_32F); int RefCount = *TestMat.refcount; 

How to do the same in OpenCV 3.0.0b?

+5
source share
1 answer
 int RefCount = TestMat.u ? (*TestMat.u->refcount) : 0; 

The control counter is in the UMatData u field. See https://github.com/jet47/opencv/blob/master/modules/core/include/opencv2/core/mat.hpp#L455 for a UMatData .

+9
source

Source: https://habr.com/ru/post/1212126/


All Articles