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
bd13e947
Commit
bd13e947
authored
Mar 27, 2012
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added assertion on device features (global atomics) into gpu tests
parent
4a996111
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
15 deletions
+35
-15
brute_force_matcher.cpp
modules/gpu/src/brute_force_matcher.cpp
+0
-0
surf.cu
modules/gpu/src/cuda/surf.cu
+0
-0
fast.cpp
modules/gpu/src/fast.cpp
+9
-6
surf.cpp
modules/gpu/src/surf.cpp
+6
-4
test_features2d.cpp
modules/gpu/test/test_features2d.cpp
+0
-0
test_filters.cpp
modules/gpu/test/test_filters.cpp
+20
-5
No files found.
modules/gpu/src/brute_force_matcher.cpp
View file @
bd13e947
This diff is collapsed.
Click to expand it.
modules/gpu/src/cuda/surf.cu
View file @
bd13e947
This diff is collapsed.
Click to expand it.
modules/gpu/src/fast.cpp
View file @
bd13e947
...
...
@@ -59,7 +59,7 @@ int cv::gpu::FAST_GPU::getKeyPoints(GpuMat&) { throw_nogpu(); return 0; }
#else
/* !defined (HAVE_CUDA) */
cv
::
gpu
::
FAST_GPU
::
FAST_GPU
(
int
_threshold
,
bool
_nonmaxSupression
,
double
_keypointsRatio
)
:
cv
::
gpu
::
FAST_GPU
::
FAST_GPU
(
int
_threshold
,
bool
_nonmaxSupression
,
double
_keypointsRatio
)
:
nonmaxSupression
(
_nonmaxSupression
),
threshold
(
_threshold
),
keypointsRatio
(
_keypointsRatio
),
count_
(
0
)
{
}
...
...
@@ -109,9 +109,9 @@ void cv::gpu::FAST_GPU::operator ()(const GpuMat& img, const GpuMat& mask, GpuMa
keypoints
.
cols
=
getKeyPoints
(
keypoints
);
}
namespace
cv
{
namespace
gpu
{
namespace
device
namespace
cv
{
namespace
gpu
{
namespace
device
{
namespace
fast
namespace
fast
{
int
calcKeypoints_gpu
(
DevMem2Db
img
,
DevMem2Db
mask
,
short2
*
kpLoc
,
int
maxKeypoints
,
DevMem2Di
score
,
int
threshold
);
int
nonmaxSupression_gpu
(
const
short2
*
kpLoc
,
int
count
,
DevMem2Di
score
,
short2
*
loc
,
float
*
response
);
...
...
@@ -124,7 +124,9 @@ int cv::gpu::FAST_GPU::calcKeyPointsLocation(const GpuMat& img, const GpuMat& ma
CV_Assert
(
img
.
type
()
==
CV_8UC1
);
CV_Assert
(
mask
.
empty
()
||
(
mask
.
type
()
==
CV_8UC1
&&
mask
.
size
()
==
img
.
size
()));
CV_Assert
(
TargetArchs
::
builtWith
(
GLOBAL_ATOMICS
)
&&
DeviceInfo
().
supports
(
GLOBAL_ATOMICS
));
if
(
!
TargetArchs
::
builtWith
(
GLOBAL_ATOMICS
)
||
!
DeviceInfo
().
supports
(
GLOBAL_ATOMICS
))
CV_Error
(
CV_StsNotImplemented
,
"The device doesn't support global atomics"
);
int
maxKeypoints
=
static_cast
<
int
>
(
keypointsRatio
*
img
.
size
().
area
());
...
...
@@ -146,7 +148,8 @@ int cv::gpu::FAST_GPU::getKeyPoints(GpuMat& keypoints)
{
using
namespace
cv
::
gpu
::
device
::
fast
;
CV_Assert
(
TargetArchs
::
builtWith
(
GLOBAL_ATOMICS
)
&&
DeviceInfo
().
supports
(
GLOBAL_ATOMICS
));
if
(
!
TargetArchs
::
builtWith
(
GLOBAL_ATOMICS
)
||
!
DeviceInfo
().
supports
(
GLOBAL_ATOMICS
))
CV_Error
(
CV_StsNotImplemented
,
"The device doesn't support global atomics"
);
if
(
count_
==
0
)
return
0
;
...
...
@@ -160,7 +163,7 @@ int cv::gpu::FAST_GPU::getKeyPoints(GpuMat& keypoints)
kpLoc_
.
colRange
(
0
,
count_
).
copyTo
(
locRow
);
keypoints
.
row
(
1
).
setTo
(
Scalar
::
all
(
0
));
return
count_
;
return
count_
;
}
void
cv
::
gpu
::
FAST_GPU
::
release
()
...
...
modules/gpu/src/surf.cpp
View file @
bd13e947
...
...
@@ -120,7 +120,9 @@ namespace
CV_Assert
(
!
img
.
empty
()
&&
img
.
type
()
==
CV_8UC1
);
CV_Assert
(
mask
.
empty
()
||
(
mask
.
size
()
==
img
.
size
()
&&
mask
.
type
()
==
CV_8UC1
));
CV_Assert
(
surf_
.
nOctaves
>
0
&&
surf_
.
nOctaveLayers
>
0
);
CV_Assert
(
TargetArchs
::
builtWith
(
GLOBAL_ATOMICS
)
&&
DeviceInfo
().
supports
(
GLOBAL_ATOMICS
));
if
(
!
TargetArchs
::
builtWith
(
GLOBAL_ATOMICS
)
||
!
DeviceInfo
().
supports
(
GLOBAL_ATOMICS
))
CV_Error
(
CV_StsNotImplemented
,
"The device doesn't support global atomics"
);
const
int
min_size
=
calcSize
(
surf_
.
nOctaves
-
1
,
0
);
CV_Assert
(
img_rows
-
min_size
>=
0
);
...
...
@@ -184,8 +186,8 @@ namespace
{
icvInterpolateKeypoint_gpu
(
surf_
.
det
,
surf_
.
maxPosBuffer
.
ptr
<
int4
>
(),
maxCounter
,
keypoints
.
ptr
<
float
>
(
SURF_GPU
::
X_ROW
),
keypoints
.
ptr
<
float
>
(
SURF_GPU
::
Y_ROW
),
keypoints
.
ptr
<
int
>
(
SURF_GPU
::
LAPLACIAN_ROW
),
keypoints
.
ptr
<
int
>
(
SURF_GPU
::
OCTAVE_ROW
),
keypoints
.
ptr
<
float
>
(
SURF_GPU
::
SIZE_ROW
),
keypoints
.
ptr
<
float
>
(
SURF_GPU
::
HESSIAN_ROW
),
keypoints
.
ptr
<
int
>
(
SURF_GPU
::
LAPLACIAN_ROW
),
keypoints
.
ptr
<
int
>
(
SURF_GPU
::
OCTAVE_ROW
),
keypoints
.
ptr
<
float
>
(
SURF_GPU
::
SIZE_ROW
),
keypoints
.
ptr
<
float
>
(
SURF_GPU
::
HESSIAN_ROW
),
counters
.
ptr
<
unsigned
int
>
());
}
}
...
...
@@ -306,7 +308,7 @@ void cv::gpu::SURF_GPU::downloadKeypoints(const GpuMat& keypointsGPU, vector<Key
Mat
keypointsCPU
(
keypointsGPU
);
keypoints
.
resize
(
nFeatures
);
float
*
kp_x
=
keypointsCPU
.
ptr
<
float
>
(
SURF_GPU
::
X_ROW
);
float
*
kp_y
=
keypointsCPU
.
ptr
<
float
>
(
SURF_GPU
::
Y_ROW
);
int
*
kp_laplacian
=
keypointsCPU
.
ptr
<
int
>
(
SURF_GPU
::
LAPLACIAN_ROW
);
...
...
modules/gpu/test/test_features2d.cpp
View file @
bd13e947
This diff is collapsed.
Click to expand it.
modules/gpu/test/test_filters.cpp
View file @
bd13e947
...
...
@@ -258,13 +258,28 @@ TEST_P(GaussianBlur, Accuracy)
double
sigma1
=
randomDouble
(
0.1
,
1.0
);
double
sigma2
=
randomDouble
(
0.1
,
1.0
);
cv
::
gpu
::
GpuMat
dst
=
createMat
(
size
,
type
,
useRoi
);
cv
::
gpu
::
GaussianBlur
(
loadMat
(
src
,
useRoi
),
dst
,
ksize
,
sigma1
,
sigma2
,
borderType
);
if
(
ksize
.
height
>
16
&&
!
supportFeature
(
devInfo
,
cv
::
gpu
::
FEATURE_SET_COMPUTE_20
))
{
try
{
cv
::
gpu
::
GpuMat
dst
;
cv
::
gpu
::
GaussianBlur
(
loadMat
(
src
),
dst
,
ksize
,
sigma1
,
sigma2
,
borderType
);
}
catch
(
const
cv
::
Exception
&
e
)
{
ASSERT_EQ
(
CV_StsNotImplemented
,
e
.
code
);
}
}
else
{
cv
::
gpu
::
GpuMat
dst
=
createMat
(
size
,
type
,
useRoi
);
cv
::
gpu
::
GaussianBlur
(
loadMat
(
src
,
useRoi
),
dst
,
ksize
,
sigma1
,
sigma2
,
borderType
);
cv
::
Mat
dst_gold
;
cv
::
GaussianBlur
(
src
,
dst_gold
,
ksize
,
sigma1
,
sigma2
,
borderType
);
cv
::
Mat
dst_gold
;
cv
::
GaussianBlur
(
src
,
dst_gold
,
ksize
,
sigma1
,
sigma2
,
borderType
);
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
4.0
);
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
4.0
);
}
}
INSTANTIATE_TEST_CASE_P
(
GPU_Filter
,
GaussianBlur
,
testing
::
Combine
(
...
...
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