Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
74c77d82
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,发现更多精彩内容 >>
提交
74c77d82
编写于
8月 21, 2014
作者:
A
Alexander Mordvintsev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
base class name resolution
fixed find_obj.py
上级
40d0f853
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
8 deletion
+24
-8
modules/python/common.cmake
modules/python/common.cmake
+2
-0
modules/python/src2/gen2.py
modules/python/src2/gen2.py
+14
-3
samples/python2/find_obj.py
samples/python2/find_obj.py
+8
-5
未找到文件。
modules/python/common.cmake
浏览文件 @
74c77d82
...
...
@@ -16,6 +16,7 @@ endforeach(mp)
ocv_list_filterout
(
candidate_deps
"^opencv_cud(a|ev)"
)
ocv_list_filterout
(
candidate_deps
"^opencv_matlab$"
)
ocv_list_filterout
(
candidate_deps
"^opencv_ts$"
)
ocv_list_filterout
(
candidate_deps
"^opencv_adas$"
)
ocv_add_module
(
${
MODULE_NAME
}
BINDINGS OPTIONAL
${
candidate_deps
}
)
...
...
@@ -35,6 +36,7 @@ ocv_list_filterout(opencv_hdrs ".h$")
ocv_list_filterout
(
opencv_hdrs
"cuda"
)
ocv_list_filterout
(
opencv_hdrs
"cudev"
)
ocv_list_filterout
(
opencv_hdrs
"opencv2/objdetect/detection_based_tracker.hpp"
)
ocv_list_filterout
(
opencv_hdrs
"opencv2/ximgproc/structured_edge_detection.hpp"
)
set
(
cv2_generated_hdrs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_include.h"
...
...
modules/python/src2/gen2.py
浏览文件 @
74c77d82
...
...
@@ -267,7 +267,7 @@ class ClassInfo(object):
#return sys.exit(-1)
if
self
.
bases
and
self
.
bases
[
0
].
startswith
(
"cv::"
):
self
.
bases
[
0
]
=
self
.
bases
[
0
][
4
:]
if
self
.
bases
and
self
.
bases
[
0
]
==
"
cv::
Algorithm"
:
if
self
.
bases
and
self
.
bases
[
0
]
==
"Algorithm"
:
self
.
isalgorithm
=
True
for
m
in
decl
[
2
]:
if
m
.
startswith
(
"="
):
...
...
@@ -752,8 +752,19 @@ class PythonWrapperGenerator(object):
%
(
classinfo
.
name
,
classinfo
.
cname
))
sys
.
exit
(
-
1
)
self
.
classes
[
classinfo
.
name
]
=
classinfo
if
classinfo
.
bases
and
not
classinfo
.
isalgorithm
:
classinfo
.
isalgorithm
=
self
.
classes
[
classinfo
.
bases
[
0
].
replace
(
"::"
,
"_"
)].
isalgorithm
if
classinfo
.
bases
:
chunks
=
classinfo
.
bases
[
0
].
split
(
'::'
)
base
=
'_'
.
join
(
chunks
)
while
base
not
in
self
.
classes
and
len
(
chunks
)
>
1
:
del
chunks
[
-
2
]
base
=
'_'
.
join
(
chunks
)
if
base
not
in
self
.
classes
:
print
(
"Generator error: unable to resolve base %s for %s"
%
(
classinfo
.
bases
[
0
],
classinfo
.
name
))
sys
.
exit
(
-
1
)
classinfo
.
bases
[
0
]
=
"::"
.
join
(
chunks
)
classinfo
.
isalgorithm
|=
self
.
classes
[
base
].
isalgorithm
def
split_decl_name
(
self
,
name
):
chunks
=
name
.
split
(
'.'
)
...
...
samples/python2/find_obj.py
浏览文件 @
74c77d82
...
...
@@ -4,7 +4,7 @@
Feature-based image matching sample.
USAGE
find_obj.py [--feature=<sift|surf|orb|brisk>[-flann]] [ <image1> <image2> ]
find_obj.py [--feature=<sift|surf|orb|
akaze|
brisk>[-flann]] [ <image1> <image2> ]
--feature - Feature to use. Can be sift, surf, orb or brisk. Append '-flann'
to feature name to use Flann-based matcher instead bruteforce.
...
...
@@ -23,14 +23,17 @@ FLANN_INDEX_LSH = 6
def
init_feature
(
name
):
chunks
=
name
.
split
(
'-'
)
if
chunks
[
0
]
==
'sift'
:
detector
=
cv2
.
SIFT
()
detector
=
cv2
.
xfeatures2d
.
SIFT
()
norm
=
cv2
.
NORM_L2
elif
chunks
[
0
]
==
'surf'
:
detector
=
cv2
.
SURF
(
800
)
detector
=
cv2
.
xfeatures2d
.
SURF
(
800
)
norm
=
cv2
.
NORM_L2
elif
chunks
[
0
]
==
'orb'
:
detector
=
cv2
.
ORB
(
400
)
norm
=
cv2
.
NORM_HAMMING
elif
chunks
[
0
]
==
'akaze'
:
detector
=
cv2
.
AKAZE
()
norm
=
cv2
.
NORM_HAMMING
elif
chunks
[
0
]
==
'brisk'
:
detector
=
cv2
.
BRISK
()
norm
=
cv2
.
NORM_HAMMING
...
...
@@ -136,8 +139,8 @@ if __name__ == '__main__':
try
:
fn1
,
fn2
=
args
except
:
fn1
=
'../c/box.png'
fn2
=
'../c/box_in_scene.png'
fn1
=
'../c
pp
/box.png'
fn2
=
'../c
pp
/box_in_scene.png'
img1
=
cv2
.
imread
(
fn1
,
0
)
img2
=
cv2
.
imread
(
fn2
,
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录