projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
619e503
)
return Py_None for an empty mat (should fix #1120)
author
Vadim Pisarevsky
<no@email>
Mon, 13 Jun 2011 21:47:35 +0000
(21:47 +0000)
committer
Vadim Pisarevsky
<no@email>
Mon, 13 Jun 2011 21:47:35 +0000
(21:47 +0000)
modules/python/src2/cv2.cpp
patch
|
blob
|
history
diff --git
a/modules/python/src2/cv2.cpp
b/modules/python/src2/cv2.cpp
index
f9cfde4
..
9737f49
100644
(file)
--- a/
modules/python/src2/cv2.cpp
+++ b/
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)
{