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
fadd19b9
Commit
fadd19b9
authored
Dec 06, 2010
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added assertion on Compute Capability >= 1.1 to BruteForceMatcher_GPU_base::radiusMatch
parent
50167f6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
8 deletions
+16
-8
brute_force_matcher.cpp
modules/gpu/src/brute_force_matcher.cpp
+4
-0
brute_force_matcher.cu
modules/gpu/src/cuda/brute_force_matcher.cu
+4
-0
brute_force_matcher.cpp
tests/gpu/src/brute_force_matcher.cpp
+8
-8
No files found.
modules/gpu/src/brute_force_matcher.cpp
View file @
fadd19b9
...
...
@@ -492,6 +492,10 @@ void cv::gpu::BruteForceMatcher_GPU_base::radiusMatch(const GpuMat& queryDescs,
radiusMatchL2_gpu
<
short
>
,
radiusMatchL2_gpu
<
int
>
,
radiusMatchL2_gpu
<
float
>
,
0
,
0
}
};
int
major
,
minor
;
getComputeCapability
(
getDevice
(),
major
,
minor
);
CV_Assert
(
100
*
major
+
10
*
minor
>=
110
);
// works onle on device with CC >= 1.1
const
int
nQuery
=
queryDescs
.
rows
;
const
int
nTrain
=
trainDescs
.
rows
;
...
...
modules/gpu/src/cuda/brute_force_matcher.cu
View file @
fadd19b9
...
...
@@ -1104,6 +1104,8 @@ namespace cv { namespace gpu { namespace bfmatcher
__global__ void radiusMatch(PtrStep_<T> queryDescs_, DevMem2D_<T> trainDescs_,
float maxDistance, Mask mask, DevMem2Di trainIdx_, unsigned int* nMatches, PtrStepf distance)
{
#if defined (__CUDA_ARCH__) && __CUDA_ARCH__ >= 110
__shared__ float sdiff[BLOCK_DIM_X * BLOCK_DIM_Y];
float* sdiff_row = sdiff + BLOCK_DIM_X * threadIdx.y;
...
...
@@ -1135,6 +1137,8 @@ namespace cv { namespace gpu { namespace bfmatcher
}
}
}
#endif
}
///////////////////////////////////////////////////////////////////////////////
...
...
tests/gpu/src/brute_force_matcher.cpp
View file @
fadd19b9
...
...
@@ -67,7 +67,7 @@ protected:
const
int
desc_len
=
rng
.
uniform
(
40
,
300
);
Mat
queryCPU
(
rng
.
uniform
(
100
,
300
),
desc_len
,
CV_32F
);
rng
.
fill
(
queryCPU
,
cv
::
RNG
::
UNIFORM
,
cv
::
Scalar
::
all
(
0.0
),
cv
::
Scalar
::
all
(
1.0
));
rng
.
fill
(
queryCPU
,
cv
::
RNG
::
UNIFORM
,
cv
::
Scalar
::
all
(
0.0
),
cv
::
Scalar
::
all
(
1
0
.0
));
GpuMat
queryGPU
(
queryCPU
);
const
int
nTrains
=
rng
.
uniform
(
1
,
5
);
...
...
@@ -81,7 +81,7 @@ protected:
for
(
int
i
=
0
;
i
<
nTrains
;
++
i
)
{
Mat
train
(
rng
.
uniform
(
100
,
300
),
desc_len
,
CV_32F
);
rng
.
fill
(
train
,
cv
::
RNG
::
UNIFORM
,
cv
::
Scalar
::
all
(
0.0
),
cv
::
Scalar
::
all
(
1.0
));
rng
.
fill
(
train
,
cv
::
RNG
::
UNIFORM
,
cv
::
Scalar
::
all
(
0.0
),
cv
::
Scalar
::
all
(
1
0
.0
));
trainsCPU
[
i
]
=
train
;
trainsGPU
[
i
].
upload
(
train
);
...
...
@@ -89,7 +89,7 @@ protected:
bool
with_mask
=
rng
.
uniform
(
0
,
10
)
<
5
;
if
(
with_mask
)
{
Mat
mask
(
queryCPU
.
rows
,
train
.
rows
,
CV_8U
,
Scalar
::
all
(
1
)
);
Mat
mask
(
queryCPU
.
rows
,
train
.
rows
,
CV_8U
);
rng
.
fill
(
mask
,
cv
::
RNG
::
UNIFORM
,
cv
::
Scalar
::
all
(
0
),
cv
::
Scalar
::
all
(
200
));
masksCPU
[
i
]
=
mask
;
...
...
@@ -111,8 +111,8 @@ protected:
const
int
knn
=
rng
.
uniform
(
3
,
10
);
matcherCPU
.
knnMatch
(
queryCPU
,
knnMatchesCPU
,
knn
,
masksCPU
);
matcherGPU
.
knnMatch
(
queryGPU
,
knnMatchesGPU
,
knn
,
masksGPU
);
matcherCPU
.
knnMatch
(
queryCPU
,
knnMatchesCPU
,
knn
,
masksCPU
,
true
);
matcherGPU
.
knnMatch
(
queryGPU
,
knnMatchesGPU
,
knn
,
masksGPU
,
true
);
if
(
!
compareMatches
(
knnMatchesCPU
,
knnMatchesGPU
))
{
...
...
@@ -120,10 +120,10 @@ protected:
return
;
}
const
float
maxDistance
=
rng
.
uniform
(
0.01
f
,
0.3
f
);
const
float
maxDistance
=
rng
.
uniform
(
25.0
f
,
65.0
f
);
matcherCPU
.
radiusMatch
(
queryCPU
,
radiusMatchesCPU
,
maxDistance
,
masksCPU
);
matcherGPU
.
radiusMatch
(
queryGPU
,
radiusMatchesGPU
,
maxDistance
,
masksGPU
);
matcherCPU
.
radiusMatch
(
queryCPU
,
radiusMatchesCPU
,
maxDistance
,
masksCPU
,
true
);
matcherGPU
.
radiusMatch
(
queryGPU
,
radiusMatchesGPU
,
maxDistance
,
masksGPU
,
true
);
if
(
!
compareMatches
(
radiusMatchesCPU
,
radiusMatchesGPU
))
{
...
...
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