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
b4652e2c
Commit
b4652e2c
authored
Jan 20, 2014
by
Elena Gvozdeva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added perf test for ocl_matchTemplate
parent
2c0765b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
2 deletions
+56
-2
perf_matchTemplate.cpp
modules/imgproc/perf/opencl/perf_matchTemplate.cpp
+55
-0
test_match_template.cpp
modules/imgproc/test/ocl/test_match_template.cpp
+1
-2
No files found.
modules/imgproc/perf/opencl/perf_matchTemplate.cpp
0 → 100644
View file @
b4652e2c
#include "perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL
namespace
cvtest
{
namespace
ocl
{
CV_ENUM
(
MethodType
,
TM_SQDIFF
,
TM_SQDIFF_NORMED
,
TM_CCORR
,
TM_CCORR_NORMED
,
TM_CCOEFF
,
TM_CCOEFF_NORMED
)
typedef
std
::
tr1
::
tuple
<
Size
,
Size
,
MethodType
>
ImgSize_TmplSize_Method_t
;
typedef
TestBaseWithParam
<
ImgSize_TmplSize_Method_t
>
ImgSize_TmplSize_Method
;
OCL_PERF_TEST_P
(
ImgSize_TmplSize_Method
,
matchTemplate
,
::
testing
::
Combine
(
testing
::
Values
(
szSmall128
,
cv
::
Size
(
320
,
240
),
cv
::
Size
(
640
,
480
),
cv
::
Size
(
800
,
600
),
cv
::
Size
(
1024
,
768
),
cv
::
Size
(
1280
,
1024
)),
testing
::
Values
(
cv
::
Size
(
12
,
12
),
cv
::
Size
(
28
,
9
),
cv
::
Size
(
8
,
30
),
cv
::
Size
(
16
,
16
)),
MethodType
::
all
()
)
)
{
Size
imgSz
=
get
<
0
>
(
GetParam
());
Size
tmplSz
=
get
<
1
>
(
GetParam
());
int
method
=
get
<
2
>
(
GetParam
());
Mat
img
(
imgSz
,
CV_8UC1
);
Mat
tmpl
(
tmplSz
,
CV_8UC1
);
Mat
result
(
imgSz
-
tmplSz
+
Size
(
1
,
1
),
CV_32F
);
declare
.
in
(
img
,
WARMUP_RNG
)
.
in
(
tmpl
,
WARMUP_RNG
)
.
out
(
result
)
.
time
(
30
);
OCL_TEST_CYCLE
()
matchTemplate
(
img
,
tmpl
,
result
,
method
);
bool
isNormed
=
method
==
TM_CCORR_NORMED
||
method
==
TM_SQDIFF_NORMED
||
method
==
TM_CCOEFF_NORMED
;
double
eps
=
isNormed
?
1e-6
:
255
*
255
*
tmpl
.
total
()
*
1e-6
;
SANITY_CHECK
(
result
,
eps
);
}
}
}
#endif // HAVE_OPENCL
\ No newline at end of file
modules/imgproc/test/ocl/test_match_template.cpp
View file @
b4652e2c
...
...
@@ -97,8 +97,7 @@ PARAM_TEST_CASE(MatchTemplate, MatDepth, Channels, int, bool)
void
Near
(
double
threshold
=
0.0
)
{
EXPECT_MAT_NEAR
(
result
,
uresult
,
threshold
);
EXPECT_MAT_NEAR
(
result_roi
,
uresult_roi
,
threshold
);
OCL_EXPECT_MATS_NEAR
(
result
,
threshold
);
}
};
...
...
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