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
cdbdb573
Commit
cdbdb573
authored
Jan 06, 2017
by
acyen
Committed by
Vladislav Sovrasov
Sep 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests to work transparently with OpenCL SURF.
parent
66843d98
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
11 deletions
+26
-11
test_features2d.cpp
modules/xfeatures2d/test/test_features2d.cpp
+4
-4
test_rotation_and_scale_invariance.cpp
...s/xfeatures2d/test/test_rotation_and_scale_invariance.cpp
+15
-7
test_surf.ocl.cpp
modules/xfeatures2d/test/test_surf.ocl.cpp
+7
-0
No files found.
modules/xfeatures2d/test/test_features2d.cpp
View file @
cdbdb573
...
...
@@ -357,9 +357,9 @@ protected:
}
if
(
imgLoadMode
==
IMREAD_GRAYSCALE
)
image
.
create
(
50
,
50
,
CV_8UC1
);
image
.
create
(
256
,
256
,
CV_8UC1
);
else
image
.
create
(
50
,
50
,
CV_8UC3
);
image
.
create
(
256
,
256
,
CV_8UC3
);
try
{
dextractor
->
compute
(
image
,
keypoints
,
descriptors
);
...
...
@@ -1187,7 +1187,7 @@ TEST(Features2d_BruteForceDescriptorMatcher_knnMatch, regression)
Ptr
<
DescriptorMatcher
>
matcher
=
DescriptorMatcher
::
create
(
"BruteForce"
);
ASSERT_TRUE
(
matcher
!=
NULL
);
Mat
imgT
(
sz
,
sz
,
CV_8U
,
Scalar
(
255
));
Mat
imgT
(
256
,
256
,
CV_8U
,
Scalar
(
255
));
line
(
imgT
,
Point
(
20
,
sz
/
2
),
Point
(
sz
-
21
,
sz
/
2
),
Scalar
(
100
),
2
);
line
(
imgT
,
Point
(
sz
/
2
,
20
),
Point
(
sz
/
2
,
sz
-
21
),
Scalar
(
100
),
2
);
vector
<
KeyPoint
>
kpT
;
...
...
@@ -1196,7 +1196,7 @@ TEST(Features2d_BruteForceDescriptorMatcher_knnMatch, regression)
Mat
descT
;
ext
->
compute
(
imgT
,
kpT
,
descT
);
Mat
imgQ
(
sz
,
sz
,
CV_8U
,
Scalar
(
255
));
Mat
imgQ
(
256
,
256
,
CV_8U
,
Scalar
(
255
));
line
(
imgQ
,
Point
(
30
,
sz
/
2
),
Point
(
sz
-
31
,
sz
/
2
),
Scalar
(
100
),
3
);
line
(
imgQ
,
Point
(
sz
/
2
,
30
),
Point
(
sz
/
2
,
sz
-
31
),
Scalar
(
100
),
3
);
vector
<
KeyPoint
>
kpQ
;
...
...
modules/xfeatures2d/test/test_rotation_and_scale_invariance.cpp
View file @
cdbdb573
...
...
@@ -168,9 +168,6 @@ void matchKeyPoints(const vector<KeyPoint>& keypoints0, const Mat& H,
const
float
r0
=
0.5
f
*
keypoints0
[
i0
].
size
;
for
(
size_t
i1
=
0
;
i1
<
keypoints1
.
size
();
i1
++
)
{
if
(
nearestPointIndex
>=
0
&&
usedMask
[
i1
])
continue
;
float
r1
=
0.5
f
*
keypoints1
[
i1
].
size
;
float
intersectRatio
=
calcIntersectRatio
(
points0t
.
at
<
Point2f
>
(
i0
),
r0
,
keypoints1
[
i1
].
pt
,
r1
);
...
...
@@ -619,7 +616,7 @@ protected:
TEST
(
Features2d_RotationInvariance_Detector_SURF
,
regression
)
{
DetectorRotationInvarianceTest
test
(
SURF
::
create
(),
0.
44
f
,
0.
65
f
,
0.76
f
);
test
.
safe_run
();
}
...
...
@@ -859,10 +856,21 @@ TEST(Features2d_RotationInvariance2_Detector_SURF, regression)
vector
<
KeyPoint
>
keypoints
;
surf
->
detect
(
cross
,
keypoints
);
// Expect 5 keypoints. One keypoint has coordinates (50.0, 50.0).
// The other 4 keypoints should have the same response.
// The order of the keypoints is indeterminate.
ASSERT_EQ
(
keypoints
.
size
(),
(
vector
<
KeyPoint
>::
size_type
)
5
);
ASSERT_LT
(
fabs
(
keypoints
[
1
].
response
-
keypoints
[
2
].
response
),
1e-6
);
ASSERT_LT
(
fabs
(
keypoints
[
1
].
response
-
keypoints
[
3
].
response
),
1e-6
);
ASSERT_LT
(
fabs
(
keypoints
[
1
].
response
-
keypoints
[
4
].
response
),
1e-6
);
int
i1
=
-
1
;
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
if
(
keypoints
[
i
].
pt
.
x
==
50.0
f
)
;
else
if
(
i1
==
-
1
)
i1
=
i
;
else
ASSERT_LT
(
fabs
(
keypoints
[
i1
].
response
-
keypoints
[
i
].
response
)
/
keypoints
[
i1
].
response
,
1e-6
);
}
}
TEST
(
DISABLED_Features2d_ScaleInvariance_Descriptor_DAISY
,
regression
)
...
...
modules/xfeatures2d/test/test_surf.ocl.cpp
View file @
cdbdb573
...
...
@@ -119,6 +119,7 @@ IMPLEMENT_PARAM_CLASS(Upright, bool)
PARAM_TEST_CASE
(
SURF
,
HessianThreshold
,
Octaves
,
OctaveLayers
,
Extended
,
Upright
)
{
bool
useOpenCL
;
double
hessianThreshold
;
int
nOctaves
;
int
nOctaveLayers
;
...
...
@@ -127,12 +128,18 @@ PARAM_TEST_CASE(SURF, HessianThreshold, Octaves, OctaveLayers, Extended, Upright
virtual
void
SetUp
()
{
useOpenCL
=
cv
::
ocl
::
useOpenCL
();
hessianThreshold
=
get
<
0
>
(
GetParam
());
nOctaves
=
get
<
1
>
(
GetParam
());
nOctaveLayers
=
get
<
2
>
(
GetParam
());
extended
=
get
<
3
>
(
GetParam
());
upright
=
get
<
4
>
(
GetParam
());
}
virtual
void
TearDown
()
{
cv
::
ocl
::
setUseOpenCL
(
useOpenCL
);
}
};
TEST_P
(
SURF
,
Detector
)
...
...
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