Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
e29cfabd
Commit
e29cfabd
authored
Nov 05, 2014
by
Michele Adduci
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjusted test cases for SURF_CUDA, using new APIs
parent
a9f4e2f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
24 deletions
+10
-24
perf_surf.cuda.cpp
modules/xfeatures2d/perf/perf_surf.cuda.cpp
+3
-2
test_surf.cuda.cpp
modules/xfeatures2d/test/test_surf.cuda.cpp
+7
-22
No files found.
modules/xfeatures2d/perf/perf_surf.cuda.cpp
View file @
e29cfabd
...
...
@@ -86,11 +86,12 @@ PERF_TEST_P(Image, CUDA_SURF,
}
else
{
cv
::
xfeatures2d
::
SURF
surf
;
cv
::
Ptr
<
cv
::
Feature2D
>
surf
=
cv
::
xfeatures2d
::
SURF
::
create
()
;
std
::
vector
<
cv
::
KeyPoint
>
cpu_keypoints
;
cv
::
Mat
cpu_descriptors
;
TEST_CYCLE
()
surf
(
img
,
cv
::
noArray
(),
cpu_keypoints
,
cpu_descriptors
);
TEST_CYCLE
()
surf
->
detect
(
img
,
cpu_keypoints
);
TEST_CYCLE
()
surf
->
compute
(
img
,
cpu_keypoints
,
cpu_descriptors
);
SANITY_CHECK_KEYPOINTS
(
cpu_keypoints
);
SANITY_CHECK
(
cpu_descriptors
);
...
...
modules/xfeatures2d/test/test_surf.cuda.cpp
View file @
e29cfabd
...
...
@@ -94,15 +94,10 @@ CUDA_TEST_P(SURF, Detector)
std
::
vector
<
cv
::
KeyPoint
>
keypoints
;
surf
(
loadMat
(
image
),
cv
::
cuda
::
GpuMat
(),
keypoints
);
cv
::
xfeatures2d
::
SURF
surf_gold
;
surf_gold
.
hessianThreshold
=
hessianThreshold
;
surf_gold
.
nOctaves
=
nOctaves
;
surf_gold
.
nOctaveLayers
=
nOctaveLayers
;
surf_gold
.
extended
=
extended
;
surf_gold
.
upright
=
upright
;
cv
::
Ptr
<
cv
::
Feature2D
>
surf_gold
=
cv
::
xfeatures2d
::
SURF
::
create
(
hessianThreshold
,
nOctaves
,
nOctaveLayers
,
extended
,
upright
);
std
::
vector
<
cv
::
KeyPoint
>
keypoints_gold
;
surf_gold
(
image
,
cv
::
noArray
()
,
keypoints_gold
);
surf_gold
->
detect
(
image
,
keypoints_gold
);
ASSERT_EQ
(
keypoints_gold
.
size
(),
keypoints
.
size
());
int
matchedCount
=
getMatchedPointsCount
(
keypoints_gold
,
keypoints
);
...
...
@@ -130,15 +125,10 @@ CUDA_TEST_P(SURF, Detector_Masked)
std
::
vector
<
cv
::
KeyPoint
>
keypoints
;
surf
(
loadMat
(
image
),
loadMat
(
mask
),
keypoints
);
cv
::
xfeatures2d
::
SURF
surf_gold
;
surf_gold
.
hessianThreshold
=
hessianThreshold
;
surf_gold
.
nOctaves
=
nOctaves
;
surf_gold
.
nOctaveLayers
=
nOctaveLayers
;
surf_gold
.
extended
=
extended
;
surf_gold
.
upright
=
upright
;
cv
::
Ptr
<
cv
::
Feature2D
>
surf_gold
=
cv
::
xfeatures2d
::
SURF
::
create
(
hessianThreshold
,
nOctaves
,
nOctaveLayers
,
extended
,
upright
);
std
::
vector
<
cv
::
KeyPoint
>
keypoints_gold
;
surf_gold
(
image
,
mask
,
keypoints_gold
);
surf_gold
->
detect
(
image
,
keypoints_gold
,
mask
);
ASSERT_EQ
(
keypoints_gold
.
size
(),
keypoints
.
size
());
int
matchedCount
=
getMatchedPointsCount
(
keypoints_gold
,
keypoints
);
...
...
@@ -160,21 +150,16 @@ CUDA_TEST_P(SURF, Descriptor)
surf
.
upright
=
upright
;
surf
.
keypointsRatio
=
0.05
f
;
cv
::
xfeatures2d
::
SURF
surf_gold
;
surf_gold
.
hessianThreshold
=
hessianThreshold
;
surf_gold
.
nOctaves
=
nOctaves
;
surf_gold
.
nOctaveLayers
=
nOctaveLayers
;
surf_gold
.
extended
=
extended
;
surf_gold
.
upright
=
upright
;
cv
::
Ptr
<
cv
::
Feature2D
>
surf_gold
=
cv
::
xfeatures2d
::
SURF
::
create
(
hessianThreshold
,
nOctaves
,
nOctaveLayers
,
extended
,
upright
);
std
::
vector
<
cv
::
KeyPoint
>
keypoints
;
surf_gold
(
image
,
cv
::
noArray
()
,
keypoints
);
surf_gold
->
detect
(
image
,
keypoints
);
cv
::
cuda
::
GpuMat
descriptors
;
surf
(
loadMat
(
image
),
cv
::
cuda
::
GpuMat
(),
keypoints
,
descriptors
,
true
);
cv
::
Mat
descriptors_gold
;
surf_gold
(
image
,
cv
::
noArray
(),
keypoints
,
descriptors_gold
,
true
);
surf_gold
->
compute
(
image
,
keypoints
,
descriptors_gold
);
cv
::
BFMatcher
matcher
(
surf
.
defaultNorm
());
std
::
vector
<
cv
::
DMatch
>
matches
;
...
...
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