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
9576133e
Commit
9576133e
authored
Apr 04, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restore support of vector<float> as possible output descriptor container in SURF::operator().
parent
e479a9f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
surf.cpp
modules/nonfree/src/surf.cpp
+19
-4
No files found.
modules/nonfree/src/surf.cpp
View file @
9576133e
...
...
@@ -877,16 +877,29 @@ void SURF::operator()(InputArray _img, InputArray _mask,
if
(
N
>
0
)
{
Mat
descriptors
;
bool
_1d
=
false
;
int
dcols
=
extended
?
128
:
64
;
size_t
dsize
=
dcols
*
sizeof
(
float
);
if
(
doDescriptors
)
{
_descriptors
.
create
((
int
)
keypoints
.
size
(),
(
extended
?
128
:
64
),
CV_32F
);
descriptors
=
_descriptors
.
getMat
();
_1d
=
_descriptors
.
kind
()
==
_InputArray
::
STD_VECTOR
&&
_descriptors
.
type
()
==
CV_32F
;
if
(
_1d
)
{
_descriptors
.
create
(
N
*
dcols
,
1
,
CV_32F
);
descriptors
=
_descriptors
.
getMat
().
reshape
(
1
,
N
);
}
else
{
_descriptors
.
create
(
N
,
dcols
,
CV_32F
);
descriptors
=
_descriptors
.
getMat
();
}
}
// we call SURFInvoker in any case, even if we do not need descriptors,
// since it computes orientation of each feature.
parallel_for
(
BlockedRange
(
0
,
N
),
SURFInvoker
(
img
,
sum
,
keypoints
,
descriptors
,
extended
,
upright
)
);
size_t
dsize
=
descriptors
.
cols
*
descriptors
.
elemSize
();
// remove keypoints that were marked for deletion
for
(
i
=
j
=
0
;
i
<
N
;
i
++
)
{
...
...
@@ -908,6 +921,8 @@ void SURF::operator()(InputArray _img, InputArray _mask,
if
(
doDescriptors
)
{
Mat
d
=
descriptors
.
rowRange
(
0
,
N
);
if
(
_1d
)
d
=
d
.
reshape
(
1
,
N
*
dcols
);
d
.
copyTo
(
_descriptors
);
}
}
...
...
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