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
1be58f9a
Commit
1be58f9a
authored
Mar 16, 2013
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SURF accuracy test is moved to nonfree
parent
6846f881
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
46 deletions
+47
-46
test_main.cpp
modules/nonfree/test/test_main.cpp
+0
-2
test_precomp.hpp
modules/nonfree/test/test_precomp.hpp
+5
-5
test_surf.ocl.cpp
modules/nonfree/test/test_surf.ocl.cpp
+42
-36
initialization.cpp
modules/ocl/src/initialization.cpp
+0
-1
precomp.hpp
modules/ocl/test/precomp.hpp
+0
-2
No files found.
modules/nonfree/test/test_main.cpp
View file @
1be58f9a
...
...
@@ -69,5 +69,3 @@ int main(int argc, char** argv)
#else // HAVE_CUDA
CV_TEST_MAIN
(
"cv"
)
#endif // HAVE_CUDA
modules/nonfree/test/test_precomp.hpp
View file @
1be58f9a
...
...
@@ -9,16 +9,16 @@
#ifndef __OPENCV_TEST_PRECOMP_HPP__
#define __OPENCV_TEST_PRECOMP_HPP__
#include <iostream>
#include "cvconfig.h"
#include "opencv2/opencv_modules.hpp"
#include "opencv2/ts/ts.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_OCL
# include "opencv2/nonfree/ocl.hpp"
#endif
#if defined(HAVE_OPENCV_GPU) && defined(HAVE_CUDA)
#include "opencv2/ts/gpu_test.hpp"
#include "opencv2/nonfree/gpu.hpp"
...
...
modules/
ocl/test/test_surf
.cpp
→
modules/
nonfree/test/test_surf.ocl
.cpp
View file @
1be58f9a
...
...
@@ -43,13 +43,12 @@
//
//M*/
#include "test_precomp.hpp"
#include "precomp.hpp"
#ifdef HAVE_OPENCL
extern
std
::
string
workdir
;
#ifdef HAVE_OPENCV_OCL
using
namespace
std
;
using
std
::
tr1
::
get
;
static
bool
keyPointsEquals
(
const
cv
::
KeyPoint
&
p1
,
const
cv
::
KeyPoint
&
p2
)
{
...
...
@@ -73,22 +72,12 @@ static bool keyPointsEquals(const cv::KeyPoint& p1, const cv::KeyPoint& p2)
return
false
;
}
struct
KeyPointLess
:
std
::
binary_function
<
cv
::
KeyPoint
,
cv
::
KeyPoint
,
bool
>
{
bool
operator
()(
const
cv
::
KeyPoint
&
kp1
,
const
cv
::
KeyPoint
&
kp2
)
const
{
return
kp1
.
pt
.
y
<
kp2
.
pt
.
y
||
(
kp1
.
pt
.
y
==
kp2
.
pt
.
y
&&
kp1
.
pt
.
x
<
kp2
.
pt
.
x
);
}
};
#define ASSERT_KEYPOINTS_EQ(gold, actual) EXPECT_PRED_FORMAT2(assertKeyPointsEquals, gold, actual);
static
int
getMatchedPointsCount
(
std
::
vector
<
cv
::
KeyPoint
>&
gold
,
std
::
vector
<
cv
::
KeyPoint
>&
actual
)
{
std
::
sort
(
actual
.
begin
(),
actual
.
end
(),
KeyPointLess
());
std
::
sort
(
gold
.
begin
(),
gold
.
end
(),
KeyPointLess
());
std
::
sort
(
actual
.
begin
(),
actual
.
end
(),
perf
::
comparators
::
KeypointGreater
());
std
::
sort
(
gold
.
begin
(),
gold
.
end
(),
perf
::
comparators
::
KeypointGreater
());
int
validCount
=
0
;
...
...
@@ -122,13 +111,29 @@ static int getMatchedPointsCount(const std::vector<cv::KeyPoint>& keypoints1, co
return
validCount
;
}
IMPLEMENT_PARAM_CLASS
(
SURF_HessianThreshold
,
double
)
IMPLEMENT_PARAM_CLASS
(
SURF_Octaves
,
int
)
IMPLEMENT_PARAM_CLASS
(
SURF_OctaveLayers
,
int
)
IMPLEMENT_PARAM_CLASS
(
SURF_Extended
,
bool
)
IMPLEMENT_PARAM_CLASS
(
SURF_Upright
,
bool
)
PARAM_TEST_CASE
(
SURF
,
SURF_HessianThreshold
,
SURF_Octaves
,
SURF_OctaveLayers
,
SURF_Extended
,
SURF_Upright
)
#define PARAM_TEST_CASE(name, ...) struct name : testing::TestWithParam< std::tr1::tuple< __VA_ARGS__ > >
#define IMPLEMENT_PARAM_CLASS(name, type) \
namespace { \
class name \
{ \
public: \
name ( type arg = type ()) : val_(arg) {} \
operator type () const {return val_;} \
private: \
type val_; \
}; \
inline void PrintTo( name param, std::ostream* os) \
{ \
*os << #name << "(" << testing::PrintToString(static_cast< type >(param)) << ")"; \
}}
IMPLEMENT_PARAM_CLASS
(
HessianThreshold
,
double
)
IMPLEMENT_PARAM_CLASS
(
Octaves
,
int
)
IMPLEMENT_PARAM_CLASS
(
OctaveLayers
,
int
)
IMPLEMENT_PARAM_CLASS
(
Extended
,
bool
)
IMPLEMENT_PARAM_CLASS
(
Upright
,
bool
)
PARAM_TEST_CASE
(
SURF
,
HessianThreshold
,
Octaves
,
OctaveLayers
,
Extended
,
Upright
)
{
double
hessianThreshold
;
int
nOctaves
;
...
...
@@ -138,16 +143,17 @@ PARAM_TEST_CASE(SURF, SURF_HessianThreshold, SURF_Octaves, SURF_OctaveLayers, SU
virtual
void
SetUp
()
{
hessianThreshold
=
GET_PARAM
(
0
);
nOctaves
=
GET_PARAM
(
1
);
nOctaveLayers
=
GET_PARAM
(
2
);
extended
=
GET_PARAM
(
3
);
upright
=
GET_PARAM
(
4
);
hessianThreshold
=
get
<
0
>
(
GetParam
()
);
nOctaves
=
get
<
1
>
(
GetParam
()
);
nOctaveLayers
=
get
<
2
>
(
GetParam
()
);
extended
=
get
<
3
>
(
GetParam
()
);
upright
=
get
<
4
>
(
GetParam
()
);
}
};
TEST_P
(
SURF
,
Detector
)
{
cv
::
Mat
image
=
readImage
(
workdir
+
"fruits.jp
g"
,
cv
::
IMREAD_GRAYSCALE
);
cv
::
Mat
image
=
cv
::
imread
(
string
(
cvtest
::
TS
::
ptr
()
->
get_data_path
())
+
"shared/fruits.pn
g"
,
cv
::
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
image
.
empty
());
cv
::
ocl
::
SURF_OCL
surf
;
...
...
@@ -180,7 +186,7 @@ TEST_P(SURF, Detector)
TEST_P
(
SURF
,
Descriptor
)
{
cv
::
Mat
image
=
readImage
(
workdir
+
"fruits.jp
g"
,
cv
::
IMREAD_GRAYSCALE
);
cv
::
Mat
image
=
cv
::
imread
(
string
(
cvtest
::
TS
::
ptr
()
->
get_data_path
())
+
"shared/fruits.pn
g"
,
cv
::
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
image
.
empty
());
cv
::
ocl
::
SURF_OCL
surf
;
...
...
@@ -218,10 +224,10 @@ TEST_P(SURF, Descriptor)
}
INSTANTIATE_TEST_CASE_P
(
OCL_Features2D
,
SURF
,
testing
::
Combine
(
testing
::
Values
(
/*SURF_HessianThreshold(100.0), */
SURF_HessianThreshold
(
500.0
),
SURF_
HessianThreshold
(
1000.0
)),
testing
::
Values
(
SURF_Octaves
(
3
),
SURF_
Octaves
(
4
)),
testing
::
Values
(
SURF_OctaveLayers
(
2
),
SURF_
OctaveLayers
(
3
)),
testing
::
Values
(
SURF_Extended
(
false
),
SURF_
Extended
(
true
)),
testing
::
Values
(
SURF_Upright
(
false
),
SURF_
Upright
(
true
))));
testing
::
Values
(
HessianThreshold
(
500.0
),
HessianThreshold
(
1000.0
)),
testing
::
Values
(
Octaves
(
3
),
Octaves
(
4
)),
testing
::
Values
(
OctaveLayers
(
2
),
OctaveLayers
(
3
)),
testing
::
Values
(
Extended
(
false
),
Extended
(
true
)),
testing
::
Values
(
Upright
(
false
),
Upright
(
true
))));
#endif
#endif
// HAVE_OPENCV_OCL
modules/ocl/src/initialization.cpp
View file @
1be58f9a
...
...
@@ -331,7 +331,6 @@ namespace cv
size_t
widthInBytes
,
size_t
height
,
DevMemRW
rw_type
,
DevMemType
mem_type
)
{
cl_int
status
;
*
dev_ptr
=
clCreateBuffer
(
clCxt
->
impl
->
clContext
,
gDevMemRWValueMap
[
rw_type
]
|
gDevMemTypeValueMap
[
mem_type
],
widthInBytes
*
height
,
0
,
&
status
);
openCLVerifyCall
(
status
);
...
...
modules/ocl/test/precomp.hpp
View file @
1be58f9a
...
...
@@ -68,9 +68,7 @@
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/video/video.hpp"
#include "opencv2/ts/ts.hpp"
#include "opencv2/ts/ts_perf.hpp"
#include "opencv2/ocl/ocl.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include "utility.hpp"
#include "interpolation.hpp"
...
...
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