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
ba84eb58
Commit
ba84eb58
authored
Dec 26, 2014
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3545 from jet47:gpu-match-template-tests
parents
1ed22204
d00f36ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
test_imgproc.cpp
modules/gpu/test/test_imgproc.cpp
+24
-2
No files found.
modules/gpu/test/test_imgproc.cpp
View file @
ba84eb58
...
@@ -692,7 +692,18 @@ GPU_TEST_P(MatchTemplate8U, Accuracy)
...
@@ -692,7 +692,18 @@ GPU_TEST_P(MatchTemplate8U, Accuracy)
cv
::
Mat
dst_gold
;
cv
::
Mat
dst_gold
;
cv
::
matchTemplate
(
image
,
templ
,
dst_gold
,
method
);
cv
::
matchTemplate
(
image
,
templ
,
dst_gold
,
method
);
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
templ_size
.
area
()
*
1e-1
);
cv
::
Mat
h_dst
(
dst
);
ASSERT_EQ
(
dst_gold
.
size
(),
h_dst
.
size
());
ASSERT_EQ
(
dst_gold
.
type
(),
h_dst
.
type
());
for
(
int
y
=
0
;
y
<
h_dst
.
rows
;
++
y
)
{
for
(
int
x
=
0
;
x
<
h_dst
.
cols
;
++
x
)
{
float
gold_val
=
dst_gold
.
at
<
float
>
(
y
,
x
);
float
actual_val
=
dst_gold
.
at
<
float
>
(
y
,
x
);
ASSERT_FLOAT_EQ
(
gold_val
,
actual_val
)
<<
y
<<
", "
<<
x
;
}
}
}
}
INSTANTIATE_TEST_CASE_P
(
GPU_ImgProc
,
MatchTemplate8U
,
testing
::
Combine
(
INSTANTIATE_TEST_CASE_P
(
GPU_ImgProc
,
MatchTemplate8U
,
testing
::
Combine
(
...
@@ -738,7 +749,18 @@ GPU_TEST_P(MatchTemplate32F, Regression)
...
@@ -738,7 +749,18 @@ GPU_TEST_P(MatchTemplate32F, Regression)
cv
::
Mat
dst_gold
;
cv
::
Mat
dst_gold
;
cv
::
matchTemplate
(
image
,
templ
,
dst_gold
,
method
);
cv
::
matchTemplate
(
image
,
templ
,
dst_gold
,
method
);
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
templ_size
.
area
()
*
1e-1
);
cv
::
Mat
h_dst
(
dst
);
ASSERT_EQ
(
dst_gold
.
size
(),
h_dst
.
size
());
ASSERT_EQ
(
dst_gold
.
type
(),
h_dst
.
type
());
for
(
int
y
=
0
;
y
<
h_dst
.
rows
;
++
y
)
{
for
(
int
x
=
0
;
x
<
h_dst
.
cols
;
++
x
)
{
float
gold_val
=
dst_gold
.
at
<
float
>
(
y
,
x
);
float
actual_val
=
dst_gold
.
at
<
float
>
(
y
,
x
);
ASSERT_FLOAT_EQ
(
gold_val
,
actual_val
)
<<
y
<<
", "
<<
x
;
}
}
}
}
INSTANTIATE_TEST_CASE_P
(
GPU_ImgProc
,
MatchTemplate32F
,
testing
::
Combine
(
INSTANTIATE_TEST_CASE_P
(
GPU_ImgProc
,
MatchTemplate32F
,
testing
::
Combine
(
...
...
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