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
fa570561
Commit
fa570561
authored
Mar 25, 2014
by
Andrey Pavlenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
splitting plain and OCL tests for SURF.
parent
c1acbb02
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
60 deletions
+105
-60
perf_main.cpp
modules/nonfree/perf/perf_main.cpp
+1
-1
perf_surf.cpp
modules/nonfree/perf/perf_surf.cpp
+15
-59
perf_surf_ocl.cpp
modules/nonfree/perf/perf_surf_ocl.cpp
+89
-0
No files found.
modules/nonfree/perf/perf_main.cpp
View file @
fa570561
...
...
@@ -36,6 +36,6 @@ int main(int argc, char **argv)
#elif defined(HAVE_OPENCL)
CV_PERF_TEST_MAIN_INTERNALS
(
nonfree
,
impls
,
dumpOpenCLDevice
());
#else
CV_PERF_TEST_MAIN_INTERNALS
(
ocl
,
impls
)
CV_PERF_TEST_MAIN_INTERNALS
(
nonfree
,
impls
)
#endif
}
modules/nonfree/perf/perf_surf.cpp
View file @
fa570561
...
...
@@ -12,98 +12,54 @@ typedef perf::TestBaseWithParam<std::string> surf;
"cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\
"stitching/a3.png"
#ifdef HAVE_OPENCV_OCL
#define OCL_TEST_CYCLE() for( ; startTimer(), next(); cv::ocl::finish(), stopTimer())
#endif
PERF_TEST_P
(
surf
,
DISABLED_detect
,
testing
::
Values
(
SURF_IMAGES
))
PERF_TEST_P
(
surf
,
detect
,
testing
::
Values
(
SURF_IMAGES
))
{
String
filename
=
getDataPath
(
GetParam
());
Mat
frame
=
imread
(
filename
,
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
frame
.
empty
())
<<
"Unable to load source image "
<<
filename
;
declare
.
in
(
frame
);
Mat
mask
;
declare
.
in
(
frame
).
time
(
90
);
SURF
detector
;
vector
<
KeyPoint
>
points
;
Ptr
<
Feature2D
>
detector
;
if
(
getSelectedImpl
()
==
"plain"
)
{
detector
=
new
SURF
;
TEST_CYCLE
()
detector
->
operator
()(
frame
,
mask
,
points
,
noArray
());
}
#ifdef HAVE_OPENCV_OCL
else
if
(
getSelectedImpl
()
==
"ocl"
)
{
detector
=
new
ocl
::
SURF_OCL
;
OCL_TEST_CYCLE
()
detector
->
operator
()(
frame
,
mask
,
points
,
noArray
());
}
#endif
else
CV_TEST_FAIL_NO_IMPL
();
TEST_CYCLE
()
detector
(
frame
,
mask
,
points
);
SANITY_CHECK_KEYPOINTS
(
points
,
1e-3
);
}
PERF_TEST_P
(
surf
,
DISABLED_
extract
,
testing
::
Values
(
SURF_IMAGES
))
PERF_TEST_P
(
surf
,
extract
,
testing
::
Values
(
SURF_IMAGES
))
{
String
filename
=
getDataPath
(
GetParam
());
Mat
frame
=
imread
(
filename
,
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
frame
.
empty
())
<<
"Unable to load source image "
<<
filename
;
declare
.
in
(
frame
);
Mat
mask
;
Ptr
<
Feature2D
>
detector
;
declare
.
in
(
frame
).
time
(
90
);
SURF
detector
;
vector
<
KeyPoint
>
points
;
vector
<
float
>
descriptors
;
detector
(
frame
,
mask
,
points
);
if
(
getSelectedImpl
()
==
"plain"
)
{
detector
=
new
SURF
;
detector
->
operator
()(
frame
,
mask
,
points
,
noArray
());
TEST_CYCLE
()
detector
->
operator
()(
frame
,
mask
,
points
,
descriptors
,
true
);
}
#ifdef HAVE_OPENCV_OCL
else
if
(
getSelectedImpl
()
==
"ocl"
)
{
detector
=
new
ocl
::
SURF_OCL
;
detector
->
operator
()(
frame
,
mask
,
points
,
noArray
());
OCL_TEST_CYCLE
()
detector
->
operator
()(
frame
,
mask
,
points
,
descriptors
,
true
);
}
#endif
else
CV_TEST_FAIL_NO_IMPL
();
TEST_CYCLE
()
detector
(
frame
,
mask
,
points
,
descriptors
,
true
);
SANITY_CHECK
(
descriptors
,
1e-4
);
}
PERF_TEST_P
(
surf
,
DISABLED_
full
,
testing
::
Values
(
SURF_IMAGES
))
PERF_TEST_P
(
surf
,
full
,
testing
::
Values
(
SURF_IMAGES
))
{
String
filename
=
getDataPath
(
GetParam
());
Mat
frame
=
imread
(
filename
,
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
frame
.
empty
())
<<
"Unable to load source image "
<<
filename
;
declare
.
in
(
frame
).
time
(
90
);
Mat
mask
;
Ptr
<
Feature2D
>
detector
;
declare
.
in
(
frame
).
time
(
90
);
SURF
detector
;
vector
<
KeyPoint
>
points
;
vector
<
float
>
descriptors
;
if
(
getSelectedImpl
()
==
"plain"
)
{
detector
=
new
SURF
;
TEST_CYCLE
()
detector
->
operator
()(
frame
,
mask
,
points
,
descriptors
,
false
);
}
#ifdef HAVE_OPENCV_OCL
else
if
(
getSelectedImpl
()
==
"ocl"
)
{
detector
=
new
ocl
::
SURF_OCL
;
detector
->
operator
()(
frame
,
mask
,
points
,
noArray
());
OCL_TEST_CYCLE
()
detector
->
operator
()(
frame
,
mask
,
points
,
descriptors
,
false
);
}
#endif
else
CV_TEST_FAIL_NO_IMPL
();
TEST_CYCLE
()
detector
(
frame
,
mask
,
points
,
descriptors
,
false
);
SANITY_CHECK_KEYPOINTS
(
points
,
1e-3
);
SANITY_CHECK
(
descriptors
,
1e-4
);
...
...
modules/nonfree/perf/perf_surf_ocl.cpp
View file @
fa570561
...
...
@@ -121,4 +121,93 @@ PERF_TEST_P(OCL_SURF, without_data_transfer, testing::Values(SURF_IMAGES))
SANITY_CHECK_NOTHING
();
}
PERF_TEST_P
(
OCL_SURF
,
DISABLED_detect
,
testing
::
Values
(
SURF_IMAGES
))
{
String
filename
=
getDataPath
(
GetParam
());
Mat
frame
=
imread
(
filename
,
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
frame
.
empty
())
<<
"Unable to load source image "
<<
filename
;
declare
.
in
(
frame
);
Mat
mask
;
vector
<
KeyPoint
>
points
;
Ptr
<
Feature2D
>
detector
;
if
(
getSelectedImpl
()
==
"plain"
)
{
detector
=
new
SURF
;
TEST_CYCLE
()
detector
->
operator
()(
frame
,
mask
,
points
,
noArray
());
}
else
if
(
getSelectedImpl
()
==
"ocl"
)
{
detector
=
new
ocl
::
SURF_OCL
;
OCL_TEST_CYCLE
()
detector
->
operator
()(
frame
,
mask
,
points
,
noArray
());
}
else
CV_TEST_FAIL_NO_IMPL
();
SANITY_CHECK_KEYPOINTS
(
points
,
1e-3
);
}
PERF_TEST_P
(
OCL_SURF
,
DISABLED_extract
,
testing
::
Values
(
SURF_IMAGES
))
{
String
filename
=
getDataPath
(
GetParam
());
Mat
frame
=
imread
(
filename
,
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
frame
.
empty
())
<<
"Unable to load source image "
<<
filename
;
declare
.
in
(
frame
);
Mat
mask
;
Ptr
<
Feature2D
>
detector
;
vector
<
KeyPoint
>
points
;
vector
<
float
>
descriptors
;
if
(
getSelectedImpl
()
==
"plain"
)
{
detector
=
new
SURF
;
detector
->
operator
()(
frame
,
mask
,
points
,
noArray
());
TEST_CYCLE
()
detector
->
operator
()(
frame
,
mask
,
points
,
descriptors
,
true
);
}
else
if
(
getSelectedImpl
()
==
"ocl"
)
{
detector
=
new
ocl
::
SURF_OCL
;
detector
->
operator
()(
frame
,
mask
,
points
,
noArray
());
OCL_TEST_CYCLE
()
detector
->
operator
()(
frame
,
mask
,
points
,
descriptors
,
true
);
}
else
CV_TEST_FAIL_NO_IMPL
();
SANITY_CHECK
(
descriptors
,
1e-4
);
}
PERF_TEST_P
(
OCL_SURF
,
DISABLED_full
,
testing
::
Values
(
SURF_IMAGES
))
{
String
filename
=
getDataPath
(
GetParam
());
Mat
frame
=
imread
(
filename
,
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
frame
.
empty
())
<<
"Unable to load source image "
<<
filename
;
declare
.
in
(
frame
).
time
(
90
);
Mat
mask
;
Ptr
<
Feature2D
>
detector
;
vector
<
KeyPoint
>
points
;
vector
<
float
>
descriptors
;
if
(
getSelectedImpl
()
==
"plain"
)
{
detector
=
new
SURF
;
TEST_CYCLE
()
detector
->
operator
()(
frame
,
mask
,
points
,
descriptors
,
false
);
}
else
if
(
getSelectedImpl
()
==
"ocl"
)
{
detector
=
new
ocl
::
SURF_OCL
;
detector
->
operator
()(
frame
,
mask
,
points
,
noArray
());
OCL_TEST_CYCLE
()
detector
->
operator
()(
frame
,
mask
,
points
,
descriptors
,
false
);
}
else
CV_TEST_FAIL_NO_IMPL
();
SANITY_CHECK_KEYPOINTS
(
points
,
1e-3
);
SANITY_CHECK
(
descriptors
,
1e-4
);
}
#endif // HAVE_OPENCV_OCL
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