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
5f4ba805
Commit
5f4ba805
authored
Jul 01, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added tests for pyrDown and pyrUp (gpu)
parent
3e1b0186
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
0 deletions
+78
-0
test_imgproc.cpp
modules/gpu/test/test_imgproc.cpp
+78
-0
No files found.
modules/gpu/test/test_imgproc.cpp
View file @
5f4ba805
...
@@ -2041,4 +2041,82 @@ INSTANTIATE_TEST_CASE_P(ImgProc, Blend, testing::Combine(
...
@@ -2041,4 +2041,82 @@ INSTANTIATE_TEST_CASE_P(ImgProc, Blend, testing::Combine(
testing
::
Values
(
CV_8U
,
CV_32F
),
testing
::
Values
(
CV_8U
,
CV_32F
),
testing
::
Range
(
1
,
5
)));
testing
::
Range
(
1
,
5
)));
////////////////////////////////////////////////////////
// pyrDown
struct
PyrDown
:
testing
::
TestWithParam
<
cv
::
gpu
::
DeviceInfo
>
{
cv
::
gpu
::
DeviceInfo
devInfo
;
virtual
void
SetUp
()
{
devInfo
=
GetParam
();
cv
::
gpu
::
setDevice
(
devInfo
.
deviceID
());
}
};
TEST_P
(
PyrDown
,
Accuracy
)
{
PRINT_PARAM
(
devInfo
);
cv
::
Mat
src
;
readImage
(
"stereobm/aloe-L.png"
).
convertTo
(
src
,
CV_16S
);
cv
::
Mat
dst_gold
;
cv
::
pyrDown
(
src
,
dst_gold
);
cv
::
gpu
::
GpuMat
d_dst
;
cv
::
gpu
::
pyrDown
(
cv
::
gpu
::
GpuMat
(
src
),
d_dst
);
cv
::
Mat
dst_mine
=
d_dst
;
ASSERT_EQ
(
dst_gold
.
cols
,
dst_mine
.
cols
);
ASSERT_EQ
(
dst_gold
.
rows
,
dst_mine
.
rows
);
ASSERT_EQ
(
dst_gold
.
type
(),
dst_mine
.
type
());
double
err
=
cvtest
::
crossCorr
(
dst_gold
,
dst_mine
)
/
(
cv
::
norm
(
dst_gold
,
cv
::
NORM_L2
)
*
cv
::
norm
(
dst_mine
,
cv
::
NORM_L2
));
ASSERT_NEAR
(
err
,
1.
,
1e-2
);
}
INSTANTIATE_TEST_CASE_P
(
ImgProc
,
PyrDown
,
testing
::
ValuesIn
(
devices
()));
////////////////////////////////////////////////////////
// pyrUp
struct
PyrUp
:
testing
::
TestWithParam
<
cv
::
gpu
::
DeviceInfo
>
{
cv
::
gpu
::
DeviceInfo
devInfo
;
virtual
void
SetUp
()
{
devInfo
=
GetParam
();
cv
::
gpu
::
setDevice
(
devInfo
.
deviceID
());
}
};
TEST_P
(
PyrUp
,
Accuracy
)
{
PRINT_PARAM
(
devInfo
);
cv
::
Mat
src
;
readImage
(
"stereobm/aloe-L.png"
).
convertTo
(
src
,
CV_16S
);
cv
::
Mat
dst_gold
;
cv
::
pyrUp
(
src
,
dst_gold
);
cv
::
gpu
::
GpuMat
d_dst
;
cv
::
gpu
::
pyrUp
(
cv
::
gpu
::
GpuMat
(
src
),
d_dst
);
cv
::
Mat
dst_mine
=
d_dst
;
ASSERT_EQ
(
dst_gold
.
cols
,
dst_mine
.
cols
);
ASSERT_EQ
(
dst_gold
.
rows
,
dst_mine
.
rows
);
ASSERT_EQ
(
dst_gold
.
type
(),
dst_mine
.
type
());
double
err
=
cvtest
::
crossCorr
(
dst_gold
,
dst_mine
)
/
(
cv
::
norm
(
dst_gold
,
cv
::
NORM_L2
)
*
cv
::
norm
(
dst_mine
,
cv
::
NORM_L2
));
ASSERT_NEAR
(
err
,
1.
,
1e-2
);
}
INSTANTIATE_TEST_CASE_P
(
ImgProc
,
PyrUp
,
testing
::
ValuesIn
(
devices
()));
#endif // HAVE_CUDA
#endif // HAVE_CUDA
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