Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
ae28345c
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,发现更多精彩内容 >>
提交
ae28345c
编写于
9月 21, 2016
作者:
V
Vladislav Sovrasov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make test_texture_flow.py more robust
上级
cd6e7ac4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
14 deletion
+7
-14
modules/python/test/test_texture_flow.py
modules/python/test/test_texture_flow.py
+7
-14
未找到文件。
modules/python/test/test_texture_flow.py
浏览文件 @
ae28345c
...
...
@@ -21,31 +21,24 @@ class texture_flow_test(NewOpenCVTests):
def
test_texture_flow
(
self
):
img
=
self
.
get_sample
(
'samples/data/
pic6
.png'
)
img
=
self
.
get_sample
(
'samples/data/
chessboard
.png'
)
gray
=
cv2
.
cvtColor
(
img
,
cv2
.
COLOR_BGR2GRAY
)
h
,
w
=
img
.
shape
[:
2
]
eigen
=
cv2
.
cornerEigenValsAndVecs
(
gray
,
1
5
,
3
)
eigen
=
cv2
.
cornerEigenValsAndVecs
(
gray
,
5
,
3
)
eigen
=
eigen
.
reshape
(
h
,
w
,
3
,
2
)
# [[e1, e2], v1, v2]
flow
=
eigen
[:,:,
2
]
vis
=
img
.
copy
()
vis
[:]
=
(
192
+
np
.
uint32
(
vis
))
/
2
d
=
80
d
=
300
eps
=
d
/
30
points
=
np
.
dstack
(
np
.
mgrid
[
d
/
2
:
w
:
d
,
d
/
2
:
h
:
d
]
).
reshape
(
-
1
,
2
)
textureVectors
=
[]
for
x
,
y
in
np
.
int32
(
points
):
textureVectors
.
append
(
np
.
int32
(
flow
[
y
,
x
]
*
d
))
eps
=
0.05
testTextureVectors
=
[[
0
,
0
],
[
0
,
0
],
[
0
,
0
],
[
0
,
0
],
[
0
,
0
],
[
-
38
,
70
],
[
-
79
,
3
],
[
0
,
0
],
[
0
,
0
],
[
-
39
,
69
],
[
-
79
,
-
1
],
[
0
,
0
],
[
0
,
0
],
[
0
,
-
79
],
[
17
,
-
78
],
[
-
48
,
-
63
],
[
65
,
-
46
],
[
-
69
,
-
39
],
[
-
48
,
-
63
],
[
-
45
,
66
]]
for
i
in
range
(
len
(
textureVectors
)):
self
.
assertLessEqual
(
cv2
.
norm
(
textureVectors
[
i
]
-
testTextureVectors
[
i
],
cv2
.
NORM_L2
),
eps
)
\ No newline at end of file
self
.
assertTrue
(
cv2
.
norm
(
textureVectors
[
i
],
cv2
.
NORM_L2
)
<
eps
or
abs
(
cv2
.
norm
(
textureVectors
[
i
],
cv2
.
NORM_L2
)
-
d
)
<
eps
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录