Closed sloretz closed 3 years ago
currently your PR disable the cv::AutoBuffer::data() also for 3.4.3+, do you think it will be an issue ?
the content of this file is not writen by me but it's more a patchwork. I would prefer a fix like
#if CV_MAJOR_VERSION >= 4 || (CV_MAJOR_VERSION == 3 && CV_VERSION_MINOR == 4 && CV_VERSION_REVISION >= 3)
// For Version >= 4 and >= 3.4.3
PyObject* o = PyArray_SimpleNew(dims, _sizes.data(), typenum);
#else
// cv::AutoBuffer::data() was added in OpenCV 3.4.3
PyObject* o = PyArray_SimpleNew(dims, _sizes, typenum);
#endif
3.4.2 : https://github.com/opencv/opencv/blob/3.4.2/modules/python/src2/cv2.cpp#L192 3.4.3 : https://github.com/opencv/opencv/blob/3.4.3/modules/python/src2/cv2.cpp#L193
I updated the preprocessor conditional to use data()
in OpenCV 3.4.3 and above. I see that 3.4.2 uses just _sizes
, but I'm a bit surprised that works. Is it invoking operator _Tp*()
? I left it as &(_sizes[0])
for now.
cv::AutoBuffer::data()
was added in OpenCV 3.4.3. This PR causes the older casting operator to be used instead on older versions.