Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
7cd4edd6
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,发现更多精彩内容 >>
提交
7cd4edd6
编写于
2月 22, 2013
作者:
A
Andrey Kamaev
提交者:
OpenCV Buildbot
2月 22, 2013
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #518 from asmorkalov:ts_refactor
上级
dea6148a
e21a1d31
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
34 deletion
+16
-34
modules/ts/src/ts_arrtest.cpp
modules/ts/src/ts_arrtest.cpp
+2
-24
modules/ts/src/ts_func.cpp
modules/ts/src/ts_func.cpp
+14
-10
未找到文件。
modules/ts/src/ts_arrtest.cpp
浏览文件 @
7cd4edd6
...
...
@@ -296,37 +296,15 @@ int ArrayTest::validate_test_results( int test_case_idx )
for
(
j
=
0
;
j
<
sizei
;
j
++
)
{
double
err_level
;
vector
<
int
>
idx
;
double
max_diff
=
0
;
int
code
;
char
msg
[
100
];
if
(
!
test_array
[
i1
][
j
]
)
continue
;
err_level
=
get_success_error_level
(
test_case_idx
,
i0
,
(
int
)
j
);
code
=
cmpEps
(
test_mat
[
i0
][
j
],
test_mat
[
i1
][
j
],
&
max_diff
,
err_level
,
&
idx
,
element_wise_relative_error
);
code
=
cmpEps
2
(
ts
,
test_mat
[
i0
][
j
],
test_mat
[
i1
][
j
],
err_level
,
element_wise_relative_error
,
arr_names
[
i0
]
);
switch
(
code
)
{
case
-
1
:
sprintf
(
msg
,
"Too big difference (=%g)"
,
max_diff
);
code
=
TS
::
FAIL_BAD_ACCURACY
;
break
;
case
-
2
:
strcpy
(
msg
,
"Invalid output"
);
code
=
TS
::
FAIL_INVALID_OUTPUT
;
break
;
case
-
3
:
strcpy
(
msg
,
"Invalid output in the reference array"
);
code
=
TS
::
FAIL_INVALID_OUTPUT
;
break
;
default:
continue
;
}
string
idxstr
=
vec2str
(
", "
,
&
idx
[
0
],
idx
.
size
());
ts
->
printf
(
TS
::
LOG
,
"%s in %s array %d at (%s)"
,
msg
,
arr_names
[
i0
],
j
,
idxstr
.
c_str
()
);
if
(
code
==
0
)
continue
;
for
(
i0
=
0
;
i0
<
(
int
)
test_array
.
size
();
i0
++
)
{
...
...
modules/ts/src/ts_func.cpp
浏览文件 @
7cd4edd6
...
...
@@ -1934,6 +1934,10 @@ int check( const Mat& a, double fmin, double fmax, vector<int>* _idx )
return
idx
==
0
?
0
:
-
1
;
}
#define CMP_EPS_OK 0
#define CMP_EPS_BIG_DIFF -1
#define CMP_EPS_INVALID_TEST_DATA -2 // there is NaN or Inf value in test data
#define CMP_EPS_INVALID_REF_DATA -3 // there is NaN or Inf value in reference data
// compares two arrays. max_diff is the maximum actual difference,
// success_err_level is maximum allowed difference, idx is the index of the first
...
...
@@ -1946,7 +1950,7 @@ int cmpEps( const Mat& arr, const Mat& refarr, double* _realmaxdiff,
CV_Assert
(
arr
.
type
()
==
refarr
.
type
()
&&
arr
.
size
==
refarr
.
size
);
int
ilevel
=
refarr
.
depth
()
<=
CV_32S
?
cvFloor
(
success_err_level
)
:
0
;
int
result
=
0
;
int
result
=
CMP_EPS_OK
;
const
Mat
*
arrays
[]
=
{
&
arr
,
&
refarr
,
0
};
Mat
planes
[
2
];
...
...
@@ -1998,13 +2002,13 @@ int cmpEps( const Mat& arr, const Mat& refarr, double* _realmaxdiff,
continue
;
if
(
cvIsNaN
(
a_val
)
||
cvIsInf
(
a_val
)
)
{
result
=
-
2
;
result
=
CMP_EPS_INVALID_TEST_DATA
;
idx
=
startidx
+
j
;
break
;
}
if
(
cvIsNaN
(
b_val
)
||
cvIsInf
(
b_val
)
)
{
result
=
-
3
;
result
=
CMP_EPS_INVALID_REF_DATA
;
idx
=
startidx
+
j
;
break
;
}
...
...
@@ -2029,13 +2033,13 @@ int cmpEps( const Mat& arr, const Mat& refarr, double* _realmaxdiff,
continue
;
if
(
cvIsNaN
(
a_val
)
||
cvIsInf
(
a_val
)
)
{
result
=
-
2
;
result
=
CMP_EPS_INVALID_TEST_DATA
;
idx
=
startidx
+
j
;
break
;
}
if
(
cvIsNaN
(
b_val
)
||
cvIsInf
(
b_val
)
)
{
result
=
-
3
;
result
=
CMP_EPS_INVALID_REF_DATA
;
idx
=
startidx
+
j
;
break
;
}
...
...
@@ -2051,7 +2055,7 @@ int cmpEps( const Mat& arr, const Mat& refarr, double* _realmaxdiff,
break
;
default:
assert
(
0
);
return
-
1
;
return
CMP_EPS_BIG_DIFF
;
}
if
(
_realmaxdiff
)
*
_realmaxdiff
=
MAX
(
*
_realmaxdiff
,
realmaxdiff
);
...
...
@@ -2060,7 +2064,7 @@ int cmpEps( const Mat& arr, const Mat& refarr, double* _realmaxdiff,
}
if
(
result
==
0
&&
idx
!=
0
)
result
=
-
1
;
result
=
CMP_EPS_BIG_DIFF
;
if
(
result
<
-
1
&&
_realmaxdiff
)
*
_realmaxdiff
=
exp
(
1000.
);
...
...
@@ -2081,15 +2085,15 @@ int cmpEps2( TS* ts, const Mat& a, const Mat& b, double success_err_level,
switch
(
code
)
{
case
-
1
:
case
CMP_EPS_BIG_DIFF
:
sprintf
(
msg
,
"%s: Too big difference (=%g)"
,
desc
,
diff
);
code
=
TS
::
FAIL_BAD_ACCURACY
;
break
;
case
-
2
:
case
CMP_EPS_INVALID_TEST_DATA
:
sprintf
(
msg
,
"%s: Invalid output"
,
desc
);
code
=
TS
::
FAIL_INVALID_OUTPUT
;
break
;
case
-
3
:
case
CMP_EPS_INVALID_REF_DATA
:
sprintf
(
msg
,
"%s: Invalid reference output"
,
desc
);
code
=
TS
::
FAIL_INVALID_OUTPUT
;
break
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录