Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
82b6419d
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,发现更多精彩内容 >>
提交
82b6419d
编写于
1月 31, 2013
作者:
V
Vadim Pisarevsky
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added tests for fast (ticket #2613) and estimateAffine3D (#2375)
上级
abd9675a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
2 deletion
+37
-2
modules/python/test/test2.py
modules/python/test/test2.py
+37
-2
未找到文件。
modules/python/test/test2.py
浏览文件 @
82b6419d
...
...
@@ -41,12 +41,47 @@ class Hackathon244Tests(NewOpenCVTests):
absa0
=
np
.
abs
(
a
)
self
.
assert_
(
cv2
.
norm
(
a
,
cv2
.
NORM_L1
)
==
15
)
absa1
=
cv2
.
absdiff
(
a
,
0
)
self
.
assert
_
(
cv2
.
norm
(
absa1
,
absa0
,
cv2
.
NORM_INF
)
==
0
)
self
.
assert
Equal
(
cv2
.
norm
(
absa1
,
absa0
,
cv2
.
NORM_INF
),
0
)
def
test_imencode
(
self
):
a
=
np
.
zeros
((
480
,
640
),
dtype
=
np
.
uint8
)
flag
,
ajpg
=
cv2
.
imencode
(
"img_q90.jpg"
,
a
,
[
cv2
.
IMWRITE_JPEG_QUALITY
,
90
])
self
.
assert_
(
flag
==
True
and
ajpg
.
dtype
==
np
.
uint8
and
ajpg
.
shape
[
0
]
>
1
and
ajpg
.
shape
[
1
]
==
1
)
self
.
assertEqual
(
flag
,
True
)
self
.
assertEqual
(
ajpg
.
dtype
,
np
.
uint8
)
self
.
assertGreater
(
ajpg
.
shape
[
0
],
1
)
self
.
assertEqual
(
ajpg
.
shape
[
1
],
1
)
def
test_projectPoints
(
self
):
objpt
=
np
.
float64
([[
1
,
2
,
3
]])
imgpt0
,
jac0
=
cv2
.
projectPoints
(
objpt
,
np
.
zeros
(
3
),
np
.
zeros
(
3
),
np
.
eye
(
3
),
np
.
float64
([]))
imgpt1
,
jac1
=
cv2
.
projectPoints
(
objpt
,
np
.
zeros
(
3
),
np
.
zeros
(
3
),
np
.
eye
(
3
),
None
)
self
.
assertEqual
(
imgpt0
.
shape
,
(
objpt
.
shape
[
0
],
1
,
2
))
self
.
assertEqual
(
imgpt1
.
shape
,
imgpt0
.
shape
)
self
.
assertEqual
(
jac0
.
shape
,
jac1
.
shape
)
self
.
assertEqual
(
jac0
.
shape
[
0
],
2
*
objpt
.
shape
[
0
])
def
test_estimateAffine3D
(
self
):
pattern_size
=
(
11
,
8
)
pattern_points
=
np
.
zeros
((
np
.
prod
(
pattern_size
),
3
),
np
.
float32
)
pattern_points
[:,:
2
]
=
np
.
indices
(
pattern_size
).
T
.
reshape
(
-
1
,
2
)
pattern_points
*=
10
(
retval
,
out
,
inliers
)
=
cv2
.
estimateAffine3D
(
pattern_points
,
pattern_points
)
self
.
assertEqual
(
retval
,
1
)
if
cv2
.
norm
(
out
[
2
,:])
<
1e-3
:
out
[
2
,
2
]
=
1
self
.
assertLess
(
cv2
.
norm
(
out
,
np
.
float64
([[
1
,
0
,
0
,
0
],
[
0
,
1
,
0
,
0
],
[
0
,
0
,
1
,
0
]])),
1e-3
)
self
.
assertEqual
(
cv2
.
countNonZero
(
inliers
),
pattern_size
[
0
]
*
pattern_size
[
1
])
def
test_fast
(
self
):
fd
=
cv2
.
FastFeatureDetector
(
30
,
True
)
img
=
self
.
get_sample
(
"samples/cpp/right02.jpg"
,
0
)
img
=
cv2
.
medianBlur
(
img
,
3
)
imgc
=
cv2
.
cvtColor
(
img
,
cv2
.
COLOR_GRAY2BGR
)
keypoints
=
fd
.
detect
(
img
)
self
.
assert_
(
600
<=
len
(
keypoints
)
<=
700
)
for
kpt
in
keypoints
:
self
.
assertNotEqual
(
kpt
.
response
,
0
)
if
__name__
==
'__main__'
:
print
"testing"
,
cv
.
__version__
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录