Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
18295bc7
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
18295bc7
编写于
10月 11, 2012
作者:
A
Andrey Kamaev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve performance tests failures formatting
上级
8f44f25f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
42 addition
and
25 deletion
+42
-25
modules/ts/src/ts_perf.cpp
modules/ts/src/ts_perf.cpp
+42
-25
未找到文件。
modules/ts/src/ts_perf.cpp
浏览文件 @
18295bc7
...
...
@@ -326,42 +326,53 @@ void Regression::verify(cv::FileNode node, cv::Mat actual, double _eps, std::str
double
actual_min
,
actual_max
;
cv
::
minMaxLoc
(
actual
,
&
actual_min
,
&
actual_max
);
double
eps
=
evalEps
((
double
)
node
[
"min"
],
actual_min
,
_eps
,
err
);
ASSERT_NEAR
((
double
)
node
[
"min"
],
actual_min
,
eps
)
<<
" "
<<
argname
<<
" has unexpected minimal value"
;
double
expect_min
=
(
double
)
node
[
"min"
];
double
eps
=
evalEps
(
expect_min
,
actual_min
,
_eps
,
err
);
ASSERT_NEAR
(
expect_min
,
actual_min
,
eps
)
<<
argname
<<
" has unexpected minimal value"
<<
std
::
endl
;
eps
=
evalEps
((
double
)
node
[
"max"
],
actual_max
,
_eps
,
err
);
ASSERT_NEAR
((
double
)
node
[
"max"
],
actual_max
,
eps
)
<<
" "
<<
argname
<<
" has unexpected maximal value"
;
double
expect_max
=
(
double
)
node
[
"max"
];
eps
=
evalEps
(
expect_max
,
actual_max
,
_eps
,
err
);
ASSERT_NEAR
(
expect_max
,
actual_max
,
eps
)
<<
argname
<<
" has unexpected maximal value"
<<
std
::
endl
;
cv
::
FileNode
last
=
node
[
"last"
];
double
actualLast
=
getElem
(
actual
,
actual
.
rows
-
1
,
actual
.
cols
-
1
,
actual
.
channels
()
-
1
);
ASSERT_EQ
((
int
)
last
[
"x"
],
actual
.
cols
-
1
)
<<
" "
<<
argname
<<
" has unexpected number of columns"
;
ASSERT_EQ
((
int
)
last
[
"y"
],
actual
.
rows
-
1
)
<<
" "
<<
argname
<<
" has unexpected number of rows"
;
eps
=
evalEps
((
double
)
last
[
"val"
],
actualLast
,
_eps
,
err
);
ASSERT_NEAR
((
double
)
last
[
"val"
],
actualLast
,
eps
)
<<
" "
<<
argname
<<
" has unexpected value of last element"
;
double
actual_last
=
getElem
(
actual
,
actual
.
rows
-
1
,
actual
.
cols
-
1
,
actual
.
channels
()
-
1
);
int
expect_cols
=
(
int
)
last
[
"x"
]
+
1
;
int
expect_rows
=
(
int
)
last
[
"y"
]
+
1
;
ASSERT_EQ
(
expect_cols
,
actual
.
cols
)
<<
argname
<<
" has unexpected number of columns"
<<
std
::
endl
;
ASSERT_EQ
(
expect_rows
,
actual
.
rows
)
<<
argname
<<
" has unexpected number of rows"
<<
std
::
endl
;
double
expect_last
=
(
double
)
last
[
"val"
];
eps
=
evalEps
(
expect_last
,
actual_last
,
_eps
,
err
);
ASSERT_NEAR
(
expect_last
,
actual_last
,
eps
)
<<
argname
<<
" has unexpected value of the last element"
<<
std
::
endl
;
cv
::
FileNode
rng1
=
node
[
"rng1"
];
int
x1
=
rng1
[
"x"
];
int
y1
=
rng1
[
"y"
];
int
cn1
=
rng1
[
"cn"
];
eps
=
evalEps
((
double
)
rng1
[
"val"
],
getElem
(
actual
,
y1
,
x1
,
cn1
),
_eps
,
err
);
ASSERT_NEAR
((
double
)
rng1
[
"val"
],
getElem
(
actual
,
y1
,
x1
,
cn1
),
eps
)
<<
" "
<<
argname
<<
" has unexpected value of ["
<<
x1
<<
":"
<<
y1
<<
":"
<<
cn1
<<
"] element"
;
double
expect_rng1
=
(
double
)
rng1
[
"val"
];
double
actual_rng1
=
getElem
(
actual
,
y1
,
x1
,
cn1
);
eps
=
evalEps
(
expect_rng1
,
actual_rng1
,
_eps
,
err
);
ASSERT_NEAR
(
expect_rng1
,
actual_rng1
,
eps
)
<<
argname
<<
" has unexpected value of the ["
<<
x1
<<
":"
<<
y1
<<
":"
<<
cn1
<<
"] element"
<<
std
::
endl
;
cv
::
FileNode
rng2
=
node
[
"rng2"
];
int
x2
=
rng2
[
"x"
];
int
y2
=
rng2
[
"y"
];
int
cn2
=
rng2
[
"cn"
];
eps
=
evalEps
((
double
)
rng2
[
"val"
],
getElem
(
actual
,
y2
,
x2
,
cn2
),
_eps
,
err
);
ASSERT_NEAR
((
double
)
rng2
[
"val"
],
getElem
(
actual
,
y2
,
x2
,
cn2
),
eps
)
<<
" "
<<
argname
<<
" has unexpected value of ["
<<
x2
<<
":"
<<
y2
<<
":"
<<
cn2
<<
"] element"
;
double
expect_rng2
=
(
double
)
rng2
[
"val"
];
double
actual_rng2
=
getElem
(
actual
,
y2
,
x2
,
cn2
);
eps
=
evalEps
(
expect_rng2
,
actual_rng2
,
_eps
,
err
);
ASSERT_NEAR
(
expect_rng2
,
actual_rng2
,
eps
)
<<
argname
<<
" has unexpected value of the ["
<<
x2
<<
":"
<<
y2
<<
":"
<<
cn2
<<
"] element"
<<
std
::
endl
;
}
void
Regression
::
write
(
cv
::
InputArray
array
)
...
...
@@ -417,13 +428,16 @@ static int countViolations(const cv::Mat& expected, const cv::Mat& actual, const
void
Regression
::
verify
(
cv
::
FileNode
node
,
cv
::
InputArray
array
,
double
eps
,
ERROR_TYPE
err
)
{
ASSERT_EQ
((
int
)
node
[
"kind"
],
array
.
kind
())
<<
" Argument
\"
"
<<
node
.
name
()
<<
"
\"
has unexpected kind"
;
ASSERT_EQ
((
int
)
node
[
"type"
],
array
.
type
())
<<
" Argument
\"
"
<<
node
.
name
()
<<
"
\"
has unexpected type"
;
int
expected_kind
=
(
int
)
node
[
"kind"
];
int
expected_type
=
(
int
)
node
[
"type"
];
ASSERT_EQ
(
expected_kind
,
array
.
kind
())
<<
" Argument
\"
"
<<
node
.
name
()
<<
"
\"
has unexpected kind"
;
ASSERT_EQ
(
expected_type
,
array
.
type
())
<<
" Argument
\"
"
<<
node
.
name
()
<<
"
\"
has unexpected type"
;
cv
::
FileNode
valnode
=
node
[
"val"
];
if
(
isVector
(
array
))
{
ASSERT_EQ
((
int
)
node
[
"len"
],
(
int
)
array
.
total
())
<<
" Vector
\"
"
<<
node
.
name
()
<<
"
\"
has unexpected length"
;
int
expected_length
=
(
int
)
node
[
"len"
];
ASSERT_EQ
(
expected_length
,
(
int
)
array
.
total
())
<<
" Vector
\"
"
<<
node
.
name
()
<<
"
\"
has unexpected length"
;
int
idx
=
node
[
"idx"
];
cv
::
Mat
actual
=
array
.
getMat
(
idx
);
...
...
@@ -485,7 +499,7 @@ void Regression::verify(cv::FileNode node, cv::InputArray array, double eps, ERR
{
ASSERT_LE
((
size_t
)
26
,
array
.
total
()
*
(
size_t
)
array
.
channels
())
<<
" Argument
\"
"
<<
node
.
name
()
<<
"
\"
has unexpected number of elements"
;
verify
(
node
,
array
.
getMat
(),
eps
,
"Argument
"
+
node
.
name
()
,
err
);
verify
(
node
,
array
.
getMat
(),
eps
,
"Argument
\"
"
+
node
.
name
()
+
"
\"
"
,
err
);
}
else
{
...
...
@@ -537,6 +551,9 @@ void Regression::verify(cv::FileNode node, cv::InputArray array, double eps, ERR
Regression
&
Regression
::
operator
()
(
const
std
::
string
&
name
,
cv
::
InputArray
array
,
double
eps
,
ERROR_TYPE
err
)
{
// exit if current test is already failed
if
(
::
testing
::
UnitTest
::
GetInstance
()
->
current_test_info
()
->
result
()
->
Failed
())
return
*
this
;
if
(
!
array
.
empty
()
&&
array
.
depth
()
==
CV_USRTYPE1
)
{
ADD_FAILURE
()
<<
" Can not check regression for CV_USRTYPE1 data type for "
<<
name
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录