return Py_None for an empty mat (should fix #1120)

pull/13383/head
Vadim Pisarevsky 14 years ago
parent 619e503d53
commit 3b97f5d5e9
  1. 5
      modules/python/src2/cv2.cpp

@ -234,6 +234,11 @@ static int pyopencv_to(const PyObject* o, Mat& m, const char* name = "<unknown>"
static PyObject* pyopencv_from(const Mat& m)
{
if( !m.data )
{
Py_INCREF(Py_None);
return Py_None;
}
Mat temp, *p = (Mat*)&m;
if(!p->refcount || p->allocator != &g_numpyAllocator)
{

Loading…
Cancel
Save