Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
c2d40b46
O
Opencv
项目概览
Greenplum
/
Opencv
10 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c2d40b46
编写于
5月 30, 2018
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
python: fix arg types of cv2_UMatWrapperObject functions
上级
1207300e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
8 deletion
+29
-8
modules/python/src2/cv2.cpp
modules/python/src2/cv2.cpp
+29
-8
未找到文件。
modules/python/src2/cv2.cpp
浏览文件 @
c2d40b46
...
...
@@ -481,8 +481,14 @@ typedef struct {
static
bool
PyObject_IsUMat
(
PyObject
*
o
);
// UMatWrapper init - try to map arguments from python to UMat constructors
static
int
UMatWrapper_init
(
cv2_UMatWrapperObject
*
self
,
PyObject
*
args
,
PyObject
*
kwds
)
static
int
UMatWrapper_init
(
PyObject
*
self_
,
PyObject
*
args
,
PyObject
*
kwds
)
{
cv2_UMatWrapperObject
*
self
=
(
cv2_UMatWrapperObject
*
)
self_
;
if
(
self
==
NULL
)
{
PyErr_SetString
(
PyExc_TypeError
,
"Internal error"
);
return
-
1
;
}
self
->
um
=
NULL
;
{
// constructor ()
...
...
@@ -555,8 +561,11 @@ static void UMatWrapper_dealloc(cv2_UMatWrapperObject* self)
// UMatWrapper.get() - returns numpy array by transferring UMat data to Mat and than wrapping it to numpy array
// (using numpy allocator - and so without unnecessary copy)
static
PyObject
*
UMatWrapper_get
(
cv2_UMatWrapperObject
*
self
)
static
PyObject
*
UMatWrapper_get
(
PyObject
*
self_
,
PyObject
*
/*args*/
)
{
cv2_UMatWrapperObject
*
self
=
(
cv2_UMatWrapperObject
*
)
self_
;
if
(
self
==
NULL
)
return
failmsgp
(
"Incorrect type of self (must be 'cv2_UMatWrapperObject')"
);
Mat
m
;
m
.
allocator
=
&
g_numpyAllocator
;
self
->
um
->
copyTo
(
m
);
...
...
@@ -565,8 +574,11 @@ static PyObject * UMatWrapper_get(cv2_UMatWrapperObject* self)
}
// UMatWrapper.handle() - returns the OpenCL handle of the UMat object
static
PyObject
*
UMatWrapper_handle
(
cv2_UMatWrapperObject
*
self
,
PyObject
*
args
,
PyObject
*
kwds
)
static
PyObject
*
UMatWrapper_handle
(
PyObject
*
self_
,
PyObject
*
args
,
PyObject
*
kwds
)
{
cv2_UMatWrapperObject
*
self
=
(
cv2_UMatWrapperObject
*
)
self_
;
if
(
self
==
NULL
)
return
failmsgp
(
"Incorrect type of self (must be 'cv2_UMatWrapperObject')"
);
const
char
*
kwlist
[]
=
{
"accessFlags"
,
NULL
};
int
accessFlags
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"i"
,
(
char
**
)
kwlist
,
&
accessFlags
))
...
...
@@ -575,31 +587,40 @@ static PyObject * UMatWrapper_handle(cv2_UMatWrapperObject* self, PyObject *args
}
// UMatWrapper.isContinuous() - returns true if the matrix data is continuous
static
PyObject
*
UMatWrapper_isContinuous
(
cv2_UMatWrapperObject
*
self
)
static
PyObject
*
UMatWrapper_isContinuous
(
PyObject
*
self_
,
PyObject
*
/*args*/
)
{
cv2_UMatWrapperObject
*
self
=
(
cv2_UMatWrapperObject
*
)
self_
;
if
(
self
==
NULL
)
return
failmsgp
(
"Incorrect type of self (must be 'cv2_UMatWrapperObject')"
);
return
PyBool_FromLong
(
self
->
um
->
isContinuous
());
}
// UMatWrapper.isContinuous() - returns true if the matrix is a submatrix of another matrix
static
PyObject
*
UMatWrapper_isSubmatrix
(
cv2_UMatWrapperObject
*
self
)
static
PyObject
*
UMatWrapper_isSubmatrix
(
PyObject
*
self_
,
PyObject
*
/*args*/
)
{
cv2_UMatWrapperObject
*
self
=
(
cv2_UMatWrapperObject
*
)
self_
;
if
(
self
==
NULL
)
return
failmsgp
(
"Incorrect type of self (must be 'cv2_UMatWrapperObject')"
);
return
PyBool_FromLong
(
self
->
um
->
isSubmatrix
());
}
// UMatWrapper.context() - returns the OpenCL context used by OpenCV UMat
static
PyObject
*
UMatWrapper_context
(
cv2_UMatWrapperObject
*
)
static
PyObject
*
UMatWrapper_context
(
PyObject
*
/*self_*/
,
PyObject
*
/*args*/
)
{
return
PyLong_FromVoidPtr
(
cv
::
ocl
::
Context
::
getDefault
().
ptr
());
}
// UMatWrapper.context() - returns the OpenCL queue used by OpenCV UMat
static
PyObject
*
UMatWrapper_queue
(
cv2_UMatWrapperObject
*
)
static
PyObject
*
UMatWrapper_queue
(
PyObject
*
/*self_*/
,
PyObject
*
/*args*/
)
{
return
PyLong_FromVoidPtr
(
cv
::
ocl
::
Queue
::
getDefault
().
ptr
());
}
static
PyObject
*
UMatWrapper_offset_getter
(
cv2_UMatWrapperObject
*
self
,
void
*
)
static
PyObject
*
UMatWrapper_offset_getter
(
PyObject
*
self_
,
void
*
)
{
cv2_UMatWrapperObject
*
self
=
(
cv2_UMatWrapperObject
*
)
self_
;
if
(
self
==
NULL
)
return
failmsgp
(
"Incorrect type of self (must be 'cv2_UMatWrapperObject')"
);
return
PyLong_FromSsize_t
(
self
->
um
->
offset
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录