refcount attribute
Can anyone explain how exactly the refcount attribute is used in OpenCV structs? I am specifically looking at refcount in CvMat. I expected refcount to be used memory management, but looking at the source code (array.cpp and matrix.cpp), I see that the value of refcount is 0 or 1. I expected to see refcount incremented in shallow copy operations like cvMatToMat(const CvMat* m, bool copyData) with copyData=false. Am I missing something or not looking at the right source files?
Thanks.
please don't try to use any of the deprecated c-api structures, like
IplImage* CvMat *, CvArr*
. they moved away from that in 2010 already, you're fighting problems, that were simply solved using the c++ api, cv::Mat.I'm trying to integrate OpenCV with existing C code, so looking into the C interface. I'm considering wrapping the C++ interface of OpenCV into C code, but don't know yet if that will be feasible.
re-write the c-code. seriously. use c++,. (or do not use opencv)
no, not an option to rewrite c code. it's in the order of 100K lines.
ok. still - don't use the discontinued c-api bindings.
try to build opencv with java support, then look at the generated jni code, to get a feeling, how it should be done.
In my opinion, if your project must use C and if there are not yet OpenCV lines of code in your project, you should consider using a pure C computer vision library instead of using the deprecated c-api of OpenCV: