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
e8b0d279
Commit
e8b0d279
authored
Jun 28, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed cvExtractSURF in case of no keypoints found #2076
parent
d60b1f2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
features2d.cpp
modules/legacy/src/features2d.cpp
+18
-18
No files found.
modules/legacy/src/features2d.cpp
View file @
e8b0d279
...
...
@@ -17,16 +17,16 @@
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
Redistributions of source code must retain the above
*
copyright notice, this list of conditions and the following
*
disclaimer.
*
Redistributions in binary form must reproduce the above
*
copyright notice, this list of conditions and the following
*
disclaimer in the documentation and/or other materials
*
provided with the distribution.
*
The name of Contributor may not be used to endorse or
*
promote products derived from this software without
*
specific prior written permission.
*
Redistributions of source code must retain the above
*
copyright notice, this list of conditions and the following
*
disclaimer.
*
Redistributions in binary form must reproduce the above
*
copyright notice, this list of conditions and the following
*
disclaimer in the documentation and/or other materials
*
provided with the distribution.
*
The name of Contributor may not be used to endorse or
*
promote products derived from this software without
*
specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
...
...
@@ -71,26 +71,26 @@ cvExtractSURF( const CvArr* _img, const CvArr* _mask,
mask
=
cvarrToMat
(
_mask
);
vector
<
KeyPoint
>
kpt
;
Mat
descr
;
Ptr
<
Feature2D
>
surf
=
Algorithm
::
create
<
Feature2D
>
(
"Feature2D.SURF"
);
if
(
surf
.
empty
()
)
CV_Error
(
CV_StsNotImplemented
,
"OpenCV was built without SURF support"
);
surf
->
set
(
"hessianThreshold"
,
params
.
hessianThreshold
);
surf
->
set
(
"nOctaves"
,
params
.
nOctaves
);
surf
->
set
(
"nOctaveLayers"
,
params
.
nOctaveLayers
);
surf
->
set
(
"upright"
,
params
.
upright
!=
0
);
surf
->
set
(
"extended"
,
params
.
extended
!=
0
);
surf
->
operator
()(
img
,
mask
,
kpt
,
_descriptors
?
_OutputArray
(
descr
)
:
noArray
(),
useProvidedKeyPts
!=
0
);
if
(
_keypoints
)
*
_keypoints
=
cvCreateSeq
(
0
,
sizeof
(
CvSeq
),
sizeof
(
CvSURFPoint
),
storage
);
if
(
_descriptors
)
*
_descriptors
=
cvCreateSeq
(
0
,
sizeof
(
CvSeq
),
descr
.
cols
*
descr
.
elemSize
(
),
storage
);
*
_descriptors
=
cvCreateSeq
(
0
,
sizeof
(
CvSeq
),
surf
->
descriptorSize
()
*
CV_ELEM_SIZE
(
surf
->
descriptorType
()
),
storage
);
for
(
size_t
i
=
0
;
i
<
kpt
.
size
();
i
++
)
{
if
(
_keypoints
)
...
...
@@ -113,7 +113,7 @@ cvGetStarKeypoints( const CvArr* _img, CvMemStorage* storage,
params
.
suppressNonmaxSize
);
vector
<
KeyPoint
>
kpts
;
star
->
detect
(
cvarrToMat
(
_img
),
kpts
,
Mat
());
CvSeq
*
seq
=
cvCreateSeq
(
0
,
sizeof
(
CvSeq
),
sizeof
(
CvStarKeypoint
),
storage
);
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
...
...
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