Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cv::Mat.refcount Missing in OpenCV 3.0

The following works in OpenCV 2.4.9:

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

How do I accomplish the same thing in OpenCV 3.0.0b?

like image 430
Greg Avatar asked Jan 28 '15 18:01

Greg


1 Answers

int RefCount = TestMat.u ? (*TestMat.u->refcount) : 0;

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

like image 81
jet47 Avatar answered Oct 22 '22 02:10

jet47