Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
18295bc7
Commit
18295bc7
authored
Oct 11, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve performance tests failures formatting
parent
8f44f25f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
25 deletions
+42
-25
ts_perf.cpp
modules/ts/src/ts_perf.cpp
+42
-25
No files found.
modules/ts/src/ts_perf.cpp
View file @
18295bc7
...
@@ -326,42 +326,53 @@ void Regression::verify(cv::FileNode node, cv::Mat actual, double _eps, std::str
...
@@ -326,42 +326,53 @@ void Regression::verify(cv::FileNode node, cv::Mat actual, double _eps, std::str
double
actual_min
,
actual_max
;
double
actual_min
,
actual_max
;
cv
::
minMaxLoc
(
actual
,
&
actual_min
,
&
actual_max
);
cv
::
minMaxLoc
(
actual
,
&
actual_min
,
&
actual_max
);
double
eps
=
evalEps
((
double
)
node
[
"min"
],
actual_min
,
_eps
,
err
);
double
expect_min
=
(
double
)
node
[
"min"
];
ASSERT_NEAR
((
double
)
node
[
"min"
],
actual_min
,
eps
)
double
eps
=
evalEps
(
expect_min
,
actual_min
,
_eps
,
err
);
<<
" "
<<
argname
<<
" has unexpected minimal value"
;
ASSERT_NEAR
(
expect_min
,
actual_min
,
eps
)
<<
argname
<<
" has unexpected minimal value"
<<
std
::
endl
;
eps
=
evalEps
((
double
)
node
[
"max"
],
actual_max
,
_eps
,
err
);
double
expect_max
=
(
double
)
node
[
"max"
];
ASSERT_NEAR
((
double
)
node
[
"max"
],
actual_max
,
eps
)
eps
=
evalEps
(
expect_max
,
actual_max
,
_eps
,
err
);
<<
" "
<<
argname
<<
" has unexpected maximal value"
;
ASSERT_NEAR
(
expect_max
,
actual_max
,
eps
)
<<
argname
<<
" has unexpected maximal value"
<<
std
::
endl
;
cv
::
FileNode
last
=
node
[
"last"
];
cv
::
FileNode
last
=
node
[
"last"
];
double
actualLast
=
getElem
(
actual
,
actual
.
rows
-
1
,
actual
.
cols
-
1
,
actual
.
channels
()
-
1
);
double
actual_last
=
getElem
(
actual
,
actual
.
rows
-
1
,
actual
.
cols
-
1
,
actual
.
channels
()
-
1
);
ASSERT_EQ
((
int
)
last
[
"x"
],
actual
.
cols
-
1
)
int
expect_cols
=
(
int
)
last
[
"x"
]
+
1
;
<<
" "
<<
argname
<<
" has unexpected number of columns"
;
int
expect_rows
=
(
int
)
last
[
"y"
]
+
1
;
ASSERT_EQ
((
int
)
last
[
"y"
],
actual
.
rows
-
1
)
ASSERT_EQ
(
expect_cols
,
actual
.
cols
)
<<
" "
<<
argname
<<
" has unexpected number of rows"
;
<<
argname
<<
" has unexpected number of columns"
<<
std
::
endl
;
ASSERT_EQ
(
expect_rows
,
actual
.
rows
)
eps
=
evalEps
((
double
)
last
[
"val"
],
actualLast
,
_eps
,
err
);
<<
argname
<<
" has unexpected number of rows"
<<
std
::
endl
;
ASSERT_NEAR
((
double
)
last
[
"val"
],
actualLast
,
eps
)
<<
" "
<<
argname
<<
" has unexpected value of last element"
;
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"
];
cv
::
FileNode
rng1
=
node
[
"rng1"
];
int
x1
=
rng1
[
"x"
];
int
x1
=
rng1
[
"x"
];
int
y1
=
rng1
[
"y"
];
int
y1
=
rng1
[
"y"
];
int
cn1
=
rng1
[
"cn"
];
int
cn1
=
rng1
[
"cn"
];
eps
=
evalEps
((
double
)
rng1
[
"val"
],
getElem
(
actual
,
y1
,
x1
,
cn1
),
_eps
,
err
);
double
expect_rng1
=
(
double
)
rng1
[
"val"
];
ASSERT_NEAR
((
double
)
rng1
[
"val"
],
getElem
(
actual
,
y1
,
x1
,
cn1
),
eps
)
double
actual_rng1
=
getElem
(
actual
,
y1
,
x1
,
cn1
);
<<
" "
<<
argname
<<
" has unexpected value of ["
<<
x1
<<
":"
<<
y1
<<
":"
<<
cn1
<<
"] element"
;
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"
];
cv
::
FileNode
rng2
=
node
[
"rng2"
];
int
x2
=
rng2
[
"x"
];
int
x2
=
rng2
[
"x"
];
int
y2
=
rng2
[
"y"
];
int
y2
=
rng2
[
"y"
];
int
cn2
=
rng2
[
"cn"
];
int
cn2
=
rng2
[
"cn"
];
eps
=
evalEps
((
double
)
rng2
[
"val"
],
getElem
(
actual
,
y2
,
x2
,
cn2
),
_eps
,
err
);
double
expect_rng2
=
(
double
)
rng2
[
"val"
];
ASSERT_NEAR
((
double
)
rng2
[
"val"
],
getElem
(
actual
,
y2
,
x2
,
cn2
),
eps
)
double
actual_rng2
=
getElem
(
actual
,
y2
,
x2
,
cn2
);
<<
" "
<<
argname
<<
" has unexpected value of ["
<<
x2
<<
":"
<<
y2
<<
":"
<<
cn2
<<
"] element"
;
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
)
void
Regression
::
write
(
cv
::
InputArray
array
)
...
@@ -417,13 +428,16 @@ static int countViolations(const cv::Mat& expected, const cv::Mat& actual, const
...
@@ -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
)
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"
;
int
expected_kind
=
(
int
)
node
[
"kind"
];
ASSERT_EQ
((
int
)
node
[
"type"
],
array
.
type
())
<<
" Argument
\"
"
<<
node
.
name
()
<<
"
\"
has unexpected type"
;
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"
];
cv
::
FileNode
valnode
=
node
[
"val"
];
if
(
isVector
(
array
))
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"
];
int
idx
=
node
[
"idx"
];
cv
::
Mat
actual
=
array
.
getMat
(
idx
);
cv
::
Mat
actual
=
array
.
getMat
(
idx
);
...
@@ -485,7 +499,7 @@ void Regression::verify(cv::FileNode node, cv::InputArray array, double eps, ERR
...
@@ -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
())
ASSERT_LE
((
size_t
)
26
,
array
.
total
()
*
(
size_t
)
array
.
channels
())
<<
" Argument
\"
"
<<
node
.
name
()
<<
"
\"
has unexpected number of elements"
;
<<
" 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
else
{
{
...
@@ -537,6 +551,9 @@ void Regression::verify(cv::FileNode node, cv::InputArray array, double eps, ERR
...
@@ -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
)
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
)
if
(
!
array
.
empty
()
&&
array
.
depth
()
==
CV_USRTYPE1
)
{
{
ADD_FAILURE
()
<<
" Can not check regression for CV_USRTYPE1 data type for "
<<
name
;
ADD_FAILURE
()
<<
" Can not check regression for CV_USRTYPE1 data type for "
<<
name
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment