You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when pyopencv_from is called, the program crashes. If I remove "Py_INCREF(o);" part from pyopencv_from function then I got following result:
>>> x = mod_imgproc.convertLeaf2Mat(a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: <built-in function convertLeaf2Mat> returned NULL without setting an error
Here is the pyopencv_from function definition:
template<>
PyObject* pyopencv_from(const Mat& m)
{
if( !m.data )
Py_RETURN_NONE;
Mat temp, *p = (Mat*)&m;
if(!p->u || p->allocator != &g_numpyAllocator)
{
temp.allocator = &g_numpyAllocator;
ERRWRAP2(m.copyTo(temp));
p = &temp;
}
PyObject* o = (PyObject*)p->u->userdata;
Py_INCREF(o);
return o;
}
I am using opencv 4.1.2. Which part could be wrong?
Thank you
The text was updated successfully, but these errors were encountered:
Hi
It is working now. Can you please delete this issue?
I started using gen.py.
gen.py was not creating the wrapper function. So I did some changes on it, then it started creating the wrapper functions.
Hello,
I am doing a python binding for a function that returns opencv mat object. so I used pyopencv_from for that as below:
But when pyopencv_from is called, the program crashes. If I remove "Py_INCREF(o);" part from pyopencv_from function then I got following result:
Here is the pyopencv_from function definition:
I am using opencv 4.1.2. Which part could be wrong?
Thank you
The text was updated successfully, but these errors were encountered: