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
582bb3c3
Commit
582bb3c3
authored
Jun 30, 2017
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core(perf): added Hamming tests
parent
e5aa2135
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
1 deletion
+57
-1
perf_norm.cpp
modules/core/perf/perf_norm.cpp
+57
-1
No files found.
modules/core/perf/perf_norm.cpp
View file @
582bb3c3
...
...
@@ -6,8 +6,10 @@ using namespace perf;
using
std
::
tr1
::
make_tuple
;
using
std
::
tr1
::
get
;
#define HAMMING_NORM_SIZES cv::Size(640, 480), cv::Size(1920, 1080)
#define HAMMING_NORM_TYPES CV_8UC1
CV_FLAGS
(
NormType
,
NORM_INF
,
NORM_L1
,
NORM_L2
,
NORM_TYPE_MASK
,
NORM_RELATIVE
,
NORM_MINMAX
)
CV_FLAGS
(
NormType
,
NORM_
HAMMING2
,
NORM_HAMMING
,
NORM_
INF
,
NORM_L1
,
NORM_L2
,
NORM_TYPE_MASK
,
NORM_RELATIVE
,
NORM_MINMAX
)
typedef
std
::
tr1
::
tuple
<
Size
,
MatType
,
NormType
>
Size_MatType_NormType_t
;
typedef
perf
::
TestBaseWithParam
<
Size_MatType_NormType_t
>
Size_MatType_NormType
;
...
...
@@ -103,6 +105,60 @@ PERF_TEST_P(Size_MatType_NormType, norm2_mask,
SANITY_CHECK
(
n
,
1e-5
,
ERROR_RELATIVE
);
}
namespace
{
typedef
std
::
tr1
::
tuple
<
NormType
,
MatType
,
Size
>
PerfHamming_t
;
typedef
perf
::
TestBaseWithParam
<
PerfHamming_t
>
PerfHamming
;
PERF_TEST_P
(
PerfHamming
,
norm
,
testing
::
Combine
(
testing
::
Values
(
NORM_HAMMING
,
NORM_HAMMING2
),
testing
::
Values
(
HAMMING_NORM_TYPES
),
testing
::
Values
(
HAMMING_NORM_SIZES
)
)
)
{
Size
sz
=
get
<
2
>
(
GetParam
());
int
matType
=
get
<
1
>
(
GetParam
());
int
normType
=
get
<
0
>
(
GetParam
());
Mat
src
(
sz
,
matType
);
double
n
;
declare
.
in
(
src
,
WARMUP_RNG
);
TEST_CYCLE
()
n
=
norm
(
src
,
normType
);
(
void
)
n
;
SANITY_CHECK_NOTHING
();
}
PERF_TEST_P
(
PerfHamming
,
norm2
,
testing
::
Combine
(
testing
::
Values
(
NORM_HAMMING
,
NORM_HAMMING2
),
testing
::
Values
(
HAMMING_NORM_TYPES
),
testing
::
Values
(
HAMMING_NORM_SIZES
)
)
)
{
Size
sz
=
get
<
2
>
(
GetParam
());
int
matType
=
get
<
1
>
(
GetParam
());
int
normType
=
get
<
0
>
(
GetParam
());
Mat
src1
(
sz
,
matType
);
Mat
src2
(
sz
,
matType
);
double
n
;
declare
.
in
(
src1
,
src2
,
WARMUP_RNG
);
TEST_CYCLE
()
n
=
norm
(
src1
,
src2
,
normType
);
(
void
)
n
;
SANITY_CHECK_NOTHING
();
}
}
PERF_TEST_P
(
Size_MatType_NormType
,
normalize
,
testing
::
Combine
(
testing
::
Values
(
TYPICAL_MAT_SIZES
),
...
...
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