Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
ed5d71b4
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
ed5d71b4
编写于
5月 13, 2014
作者:
R
Roman Donchenko
提交者:
OpenCV Buildbot
5月 13, 2014
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2724 from znah:python_autowrap
上级
ea5b411c
dd67ea02
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
57 deletion
+18
-57
modules/python/CMakeLists.txt
modules/python/CMakeLists.txt
+1
-0
modules/python/src2/cv2.cpp
modules/python/src2/cv2.cpp
+6
-55
modules/python/src2/gen2.py
modules/python/src2/gen2.py
+11
-2
未找到文件。
modules/python/CMakeLists.txt
浏览文件 @
ed5d71b4
...
...
@@ -44,6 +44,7 @@ if(HAVE_opencv_nonfree)
endif
()
set
(
cv2_generated_hdrs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_include.h"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_funcs.h"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_func_tab.h"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_types.h"
...
...
modules/python/src2/cv2.cpp
浏览文件 @
ed5d71b4
...
...
@@ -9,30 +9,12 @@
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <numpy/ndarrayobject.h>
#include "opencv2/core.hpp"
#include "opencv2/core/utility.hpp"
#include "opencv2/contrib.hpp"
#include "opencv2/flann/miniflann.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/calib3d.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/objdetect.hpp"
#include "opencv2/softcascade.hpp"
#include "opencv2/video.hpp"
#include "opencv2/photo.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/ml.hpp"
#include "pyopencv_generated_include.h"
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_NONFREE
# include "opencv2/nonfree.hpp"
#endif
#include "pycompat.hpp"
using
cv
::
flann
::
IndexParams
;
using
cv
::
flann
::
SearchParams
;
static
PyObject
*
opencv_error
=
0
;
...
...
@@ -100,7 +82,9 @@ catch (const cv::Exception &e) \
}
using
namespace
cv
;
typedef
cv
::
softcascade
::
ChannelFeatureBuilder
softcascade_ChannelFeatureBuilder
;
using
cv
::
flann
::
IndexParams
;
using
cv
::
flann
::
SearchParams
;
using
cv
::
softcascade
::
ChannelFeatureBuilder
;
typedef
std
::
vector
<
uchar
>
vector_uchar
;
typedef
std
::
vector
<
char
>
vector_char
;
...
...
@@ -119,6 +103,7 @@ typedef std::vector<KeyPoint> vector_KeyPoint;
typedef
std
::
vector
<
Mat
>
vector_Mat
;
typedef
std
::
vector
<
DMatch
>
vector_DMatch
;
typedef
std
::
vector
<
String
>
vector_String
;
typedef
std
::
vector
<
Scalar
>
vector_Scalar
;
typedef
std
::
vector
<
std
::
vector
<
char
>
>
vector_vector_char
;
typedef
std
::
vector
<
std
::
vector
<
Point
>
>
vector_vector_Point
;
...
...
@@ -126,47 +111,13 @@ typedef std::vector<std::vector<Point2f> > vector_vector_Point2f;
typedef
std
::
vector
<
std
::
vector
<
Point3f
>
>
vector_vector_Point3f
;
typedef
std
::
vector
<
std
::
vector
<
DMatch
>
>
vector_vector_DMatch
;
typedef
Ptr
<
Algorithm
>
Ptr_Algorithm
;
typedef
Ptr
<
FeatureDetector
>
Ptr_FeatureDetector
;
typedef
Ptr
<
DescriptorExtractor
>
Ptr_DescriptorExtractor
;
typedef
Ptr
<
Feature2D
>
Ptr_Feature2D
;
typedef
Ptr
<
DescriptorMatcher
>
Ptr_DescriptorMatcher
;
typedef
Ptr
<
BackgroundSubtractor
>
Ptr_BackgroundSubtractor
;
typedef
Ptr
<
BackgroundSubtractorMOG
>
Ptr_BackgroundSubtractorMOG
;
typedef
Ptr
<
BackgroundSubtractorMOG2
>
Ptr_BackgroundSubtractorMOG2
;
typedef
Ptr
<
BackgroundSubtractorKNN
>
Ptr_BackgroundSubtractorKNN
;
typedef
Ptr
<
BackgroundSubtractorGMG
>
Ptr_BackgroundSubtractorGMG
;
typedef
Ptr
<
StereoMatcher
>
Ptr_StereoMatcher
;
typedef
Ptr
<
StereoBM
>
Ptr_StereoBM
;
typedef
Ptr
<
StereoSGBM
>
Ptr_StereoSGBM
;
typedef
Ptr
<
Tonemap
>
Ptr_Tonemap
;
typedef
Ptr
<
TonemapDrago
>
Ptr_TonemapDrago
;
typedef
Ptr
<
TonemapReinhard
>
Ptr_TonemapReinhard
;
typedef
Ptr
<
TonemapDurand
>
Ptr_TonemapDurand
;
typedef
Ptr
<
TonemapMantiuk
>
Ptr_TonemapMantiuk
;
typedef
Ptr
<
AlignMTB
>
Ptr_AlignMTB
;
typedef
Ptr
<
CalibrateDebevec
>
Ptr_CalibrateDebevec
;
typedef
Ptr
<
CalibrateRobertson
>
Ptr_CalibrateRobertson
;
typedef
Ptr
<
MergeDebevec
>
Ptr_MergeDebevec
;
typedef
Ptr
<
MergeRobertson
>
Ptr_MergeRobertson
;
typedef
Ptr
<
MergeMertens
>
Ptr_MergeMertens
;
typedef
Ptr
<
MergeRobertson
>
Ptr_MergeRobertson
;
typedef
Ptr
<
cv
::
softcascade
::
ChannelFeatureBuilder
>
Ptr_ChannelFeatureBuilder
;
typedef
Ptr
<
CLAHE
>
Ptr_CLAHE
;
typedef
Ptr
<
LineSegmentDetector
>
Ptr_LineSegmentDetector
;
typedef
cv
::
softcascade
::
ChannelFeatureBuilder
softcascade_ChannelFeatureBuilder
;
typedef
SimpleBlobDetector
::
Params
SimpleBlobDetector_Params
;
typedef
cvflann
::
flann_distance_t
cvflann_flann_distance_t
;
typedef
cvflann
::
flann_algorithm_t
cvflann_flann_algorithm_t
;
typedef
Ptr
<
flann
::
IndexParams
>
Ptr_flann_IndexParams
;
typedef
Ptr
<
flann
::
SearchParams
>
Ptr_flann_SearchParams
;
typedef
Ptr
<
FaceRecognizer
>
Ptr_FaceRecognizer
;
typedef
std
::
vector
<
Scalar
>
vector_Scalar
;
static
PyObject
*
failmsgp
(
const
char
*
fmt
,
...)
{
...
...
modules/python/src2/gen2.py
浏览文件 @
ed5d71b4
...
...
@@ -351,9 +351,15 @@ class ConstInfo(object):
self
.
name
=
self
.
name
.
upper
()
self
.
value
=
val
def
handle_ptr
(
tp
):
if
tp
.
startswith
(
'Ptr_'
):
tp
=
'Ptr<'
+
"::"
.
join
(
tp
.
split
(
'_'
)[
1
:])
+
'>'
return
tp
class
ArgInfo
(
object
):
def
__init__
(
self
,
arg_tuple
):
self
.
tp
=
arg_tuple
[
0
]
self
.
tp
=
handle_ptr
(
arg_tuple
[
0
])
self
.
name
=
arg_tuple
[
1
]
self
.
defval
=
arg_tuple
[
2
]
self
.
isarray
=
False
...
...
@@ -398,7 +404,7 @@ class FuncVariant(object):
else
:
self
.
wname
=
self
.
classname
self
.
rettype
=
decl
[
1
]
self
.
rettype
=
handle_ptr
(
decl
[
1
])
if
self
.
rettype
==
"void"
:
self
.
rettype
=
""
self
.
args
=
[]
...
...
@@ -736,6 +742,7 @@ class PythonWrapperGenerator(object):
self
.
classes
=
{}
self
.
funcs
=
{}
self
.
consts
=
{}
self
.
code_include
=
StringIO
()
self
.
code_types
=
StringIO
()
self
.
code_funcs
=
StringIO
()
self
.
code_func_tab
=
StringIO
()
...
...
@@ -823,6 +830,7 @@ class PythonWrapperGenerator(object):
# step 1: scan the headers and build more descriptive maps of classes, consts, functions
for
hdr
in
srcfiles
:
self
.
code_include
.
write
(
'#include "{}"
\n
'
.
format
(
hdr
[
hdr
.
rindex
(
'opencv2/'
):])
)
decls
=
parser
.
parse
(
hdr
)
for
decl
in
decls
:
name
=
decl
[
0
]
...
...
@@ -879,6 +887,7 @@ class PythonWrapperGenerator(object):
self
.
gen_const_reg
(
constinfo
)
# That's it. Now save all the files
self
.
save
(
output_path
,
"pyopencv_generated_include.h"
,
self
.
code_include
)
self
.
save
(
output_path
,
"pyopencv_generated_funcs.h"
,
self
.
code_funcs
)
self
.
save
(
output_path
,
"pyopencv_generated_func_tab.h"
,
self
.
code_func_tab
)
self
.
save
(
output_path
,
"pyopencv_generated_const_reg.h"
,
self
.
code_const_reg
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录