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
03e2a52e
Commit
03e2a52e
authored
Apr 12, 2013
by
Vadim Pisarevsky
Committed by
OpenCV Buildbot
Apr 12, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #807 from pengx17:2.4_ocl_bfm_opt
parents
3d39087a
2338a895
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
45 deletions
+23
-45
brute_force_matcher.cpp
modules/ocl/src/brute_force_matcher.cpp
+0
-0
brute_force_match.cl
modules/ocl/src/opencl/brute_force_match.cl
+0
-0
test_brute_force_matcher.cpp
modules/ocl/test/test_brute_force_matcher.cpp
+23
-45
No files found.
modules/ocl/src/brute_force_matcher.cpp
View file @
03e2a52e
This diff is collapsed.
Click to expand it.
modules/ocl/src/opencl/brute_force_match.cl
View file @
03e2a52e
This diff is collapsed.
Click to expand it.
modules/ocl/test/test_brute_force_matcher.cpp
View file @
03e2a52e
...
@@ -43,16 +43,14 @@
...
@@ -43,16 +43,14 @@
#ifdef HAVE_OPENCL
#ifdef HAVE_OPENCL
namespace
namespace
{
{
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
// BruteForceMatcher
// BruteForceMatcher
CV_ENUM
(
DistType
,
cv
::
ocl
::
BruteForceMatcher_OCL_base
::
L1Dist
,
\
CV_ENUM
(
DistType
,
cv
::
ocl
::
BruteForceMatcher_OCL_base
::
L1Dist
,
cv
::
ocl
::
BruteForceMatcher_OCL_base
::
L2Dist
,
cv
::
ocl
::
BruteForceMatcher_OCL_base
::
HammingDist
)
cv
::
ocl
::
BruteForceMatcher_OCL_base
::
L2Dist
,
\
cv
::
ocl
::
BruteForceMatcher_OCL_base
::
HammingDist
)
IMPLEMENT_PARAM_CLASS
(
DescriptorSize
,
int
)
IMPLEMENT_PARAM_CLASS
(
DescriptorSize
,
int
)
PARAM_TEST_CASE
(
BruteForceMatcher
,
DistType
,
DescriptorSize
)
PARAM_TEST_CASE
(
BruteForceMatcher
/*, NormCode*/
,
DistType
,
DescriptorSize
)
{
{
//std::vector<cv::ocl::Info> oclinfo;
cv
::
ocl
::
BruteForceMatcher_OCL_base
::
DistType
distType
;
cv
::
ocl
::
BruteForceMatcher_OCL_base
::
DistType
distType
;
int
normCode
;
int
normCode
;
int
dim
;
int
dim
;
...
@@ -64,13 +62,9 @@ namespace
...
@@ -64,13 +62,9 @@ namespace
virtual
void
SetUp
()
virtual
void
SetUp
()
{
{
//normCode = GET_PARAM(0);
distType
=
(
cv
::
ocl
::
BruteForceMatcher_OCL_base
::
DistType
)(
int
)
GET_PARAM
(
0
);
distType
=
(
cv
::
ocl
::
BruteForceMatcher_OCL_base
::
DistType
)(
int
)
GET_PARAM
(
0
);
dim
=
GET_PARAM
(
1
);
dim
=
GET_PARAM
(
1
);
//int devnums = getDevice(oclinfo, OPENCV_DEFAULT_OPENCL_DEVICE);
//CV_Assert(devnums > 0);
queryDescCount
=
300
;
// must be even number because we split train data in some cases in two
queryDescCount
=
300
;
// must be even number because we split train data in some cases in two
countFactor
=
4
;
// do not change it
countFactor
=
4
;
// do not change it
...
@@ -172,49 +166,33 @@ namespace
...
@@ -172,49 +166,33 @@ namespace
cv
::
ocl
::
BruteForceMatcher_OCL_base
matcher
(
distType
);
cv
::
ocl
::
BruteForceMatcher_OCL_base
matcher
(
distType
);
// assume support atomic.
std
::
vector
<
std
::
vector
<
cv
::
DMatch
>
>
matches
;
//if (!supportFeature(devInfo, cv::gpu::GLOBAL_ATOMICS))
matcher
.
radiusMatch
(
cv
::
ocl
::
oclMat
(
query
),
cv
::
ocl
::
oclMat
(
train
),
matches
,
radius
);
//{
// try
// {
// std::vector< std::vector<cv::DMatch> > matches;
// matcher.radiusMatch(loadMat(query), loadMat(train), matches, radius);
// }
// catch (const cv::Exception& e)
// {
// ASSERT_EQ(CV_StsNotImplemented, e.code);
// }
//}
//else
{
std
::
vector
<
std
::
vector
<
cv
::
DMatch
>
>
matches
;
matcher
.
radiusMatch
(
cv
::
ocl
::
oclMat
(
query
),
cv
::
ocl
::
oclMat
(
train
),
matches
,
radius
);
ASSERT_EQ
(
static_cast
<
size_t
>
(
queryDescCount
),
matches
.
size
());
ASSERT_EQ
(
static_cast
<
size_t
>
(
queryDescCount
),
matches
.
size
());
int
badCount
=
0
;
int
badCount
=
0
;
for
(
size_t
i
=
0
;
i
<
matches
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
matches
.
size
();
i
++
)
{
if
((
int
)
matches
[
i
].
size
()
!=
1
)
{
{
if
((
int
)
matches
[
i
].
size
()
!=
1
)
badCount
++
;
{
}
else
{
cv
::
DMatch
match
=
matches
[
i
][
0
];
if
((
match
.
queryIdx
!=
(
int
)
i
)
||
(
match
.
trainIdx
!=
(
int
)
i
*
countFactor
)
||
(
match
.
imgIdx
!=
0
))
badCount
++
;
badCount
++
;
}
else
{
cv
::
DMatch
match
=
matches
[
i
][
0
];
if
((
match
.
queryIdx
!=
(
int
)
i
)
||
(
match
.
trainIdx
!=
(
int
)
i
*
countFactor
)
||
(
match
.
imgIdx
!=
0
))
badCount
++
;
}
}
}
ASSERT_EQ
(
0
,
badCount
);
}
}
ASSERT_EQ
(
0
,
badCount
);
}
}
INSTANTIATE_TEST_CASE_P
(
GPU_Features2D
,
BruteForceMatcher
,
testing
::
Combine
(
INSTANTIATE_TEST_CASE_P
(
OCL_Features2D
,
BruteForceMatcher
,
//ALL_DEVICES,
testing
::
Combine
(
testing
::
Values
(
DistType
(
cv
::
ocl
::
BruteForceMatcher_OCL_base
::
L1Dist
),
DistType
(
cv
::
ocl
::
BruteForceMatcher_OCL_base
::
L2Dist
)),
testing
::
Values
(
DistType
(
cv
::
ocl
::
BruteForceMatcher_OCL_base
::
L1Dist
),
DistType
(
cv
::
ocl
::
BruteForceMatcher_OCL_base
::
L2Dist
)),
testing
::
Values
(
DescriptorSize
(
57
),
DescriptorSize
(
64
),
DescriptorSize
(
83
),
DescriptorSize
(
128
),
DescriptorSize
(
179
),
DescriptorSize
(
256
),
DescriptorSize
(
304
))));
testing
::
Values
(
DescriptorSize
(
57
),
DescriptorSize
(
64
),
DescriptorSize
(
83
),
DescriptorSize
(
128
),
DescriptorSize
(
179
),
DescriptorSize
(
256
),
DescriptorSize
(
304
))));
}
// namespace
}
// namespace
#endif
#endif
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