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
b371bd68
Commit
b371bd68
authored
Sep 05, 2011
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added assertion for small image sizes to SURF_GPU (ticket #1323)
parent
914ed44e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
15 deletions
+26
-15
surf.cu
modules/gpu/src/cuda/surf.cu
+1
-1
surf.cpp
modules/gpu/src/surf.cpp
+25
-14
No files found.
modules/gpu/src/cuda/surf.cu
View file @
b371bd68
...
...
@@ -323,7 +323,7 @@ namespace cv { namespace gpu { namespace surf
const int layer_rows = img_rows >> octave;
const int layer_cols = img_cols >> octave;
int min_margin = ((calcSize(octave, 2) >> 1) >> octave) + 1;
const
int min_margin = ((calcSize(octave, 2) >> 1) >> octave) + 1;
dim3 threads(16, 16);
...
...
modules/gpu/src/surf.cpp
View file @
b371bd68
...
...
@@ -84,6 +84,21 @@ using namespace cv::gpu::surf;
namespace
{
int
calcSize
(
int
octave
,
int
layer
)
{
/* Wavelet size at first layer of first octave. */
const
int
HAAR_SIZE0
=
9
;
/* Wavelet size increment between layers. This should be an even number,
such that the wavelet sizes in an octave are either all even or all odd.
This ensures that when looking for the neighbours of a sample, the layers
above and below are aligned correctly. */
const
int
HAAR_SIZE_INC
=
6
;
return
(
HAAR_SIZE0
+
HAAR_SIZE_INC
*
layer
)
<<
octave
;
}
class
SURF_GPU_Invoker
:
private
CvSURFParams
{
public
:
...
...
@@ -102,6 +117,16 @@ namespace
CV_Assert
(
mask
.
empty
()
||
(
mask
.
size
()
==
img
.
size
()
&&
mask
.
type
()
==
CV_8UC1
));
CV_Assert
(
nOctaves
>
0
&&
nOctaveLayers
>
0
);
CV_Assert
(
TargetArchs
::
builtWith
(
GLOBAL_ATOMICS
)
&&
DeviceInfo
().
supports
(
GLOBAL_ATOMICS
));
const
int
min_size
=
calcSize
(
nOctaves
-
1
,
0
);
CV_Assert
(
img_rows
-
min_size
>=
0
);
CV_Assert
(
img_cols
-
min_size
>=
0
);
const
int
layer_rows
=
img_rows
>>
(
nOctaves
-
1
);
const
int
layer_cols
=
img_cols
>>
(
nOctaves
-
1
);
const
int
min_margin
=
((
calcSize
((
nOctaves
-
1
),
2
)
>>
1
)
>>
(
nOctaves
-
1
))
+
1
;
CV_Assert
(
layer_rows
-
2
*
min_margin
>
0
);
CV_Assert
(
layer_cols
-
2
*
min_margin
>
0
);
maxFeatures
=
min
(
static_cast
<
int
>
(
img
.
size
().
area
()
*
surf
.
keypointsRatio
),
65535
);
maxCandidates
=
min
(
static_cast
<
int
>
(
1.5
*
maxFeatures
),
65535
);
...
...
@@ -279,20 +304,6 @@ void cv::gpu::SURF_GPU::uploadKeypoints(const vector<KeyPoint>& keypoints, GpuMa
namespace
{
int
calcSize
(
int
octave
,
int
layer
)
{
/* Wavelet size at first layer of first octave. */
const
int
HAAR_SIZE0
=
9
;
/* Wavelet size increment between layers. This should be an even number,
such that the wavelet sizes in an octave are either all even or all odd.
This ensures that when looking for the neighbours of a sample, the layers
above and below are aligned correctly. */
const
int
HAAR_SIZE_INC
=
6
;
return
(
HAAR_SIZE0
+
HAAR_SIZE_INC
*
layer
)
<<
octave
;
}
int
getPointOctave
(
float
size
,
const
CvSURFParams
&
params
)
{
int
best_octave
=
0
;
...
...
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