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
909e484e
Commit
909e484e
authored
May 25, 2011
by
Vincent Rabaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fix a possible crash when only asking for features and not descriptors
parent
355ad299
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
23 deletions
+15
-23
orb.cpp
modules/features2d/src/orb.cpp
+15
-23
No files found.
modules/features2d/src/orb.cpp
View file @
909e484e
...
...
@@ -523,8 +523,6 @@ void ORB::operator()(const cv::Mat &image, const cv::Mat &mask, std::vector<cv::
if
((
!
do_keypoints
)
&&
(
!
do_descriptors
))
return
;
if
(
do_keypoints
)
keypoints_in_out
.
clear
();
if
(
do_descriptors
)
descriptors
.
release
();
...
...
@@ -560,6 +558,7 @@ void ORB::operator()(const cv::Mat &image, const cv::Mat &mask, std::vector<cv::
all_keypoints
[
keypoint
->
octave
].
push_back
(
*
keypoint
);
}
keypoints_in_out
.
clear
();
for
(
unsigned
int
level
=
0
;
level
<
params_
.
n_levels_
;
++
level
)
{
// Compute the resized image
...
...
@@ -583,29 +582,22 @@ void ORB::operator()(const cv::Mat &image, const cv::Mat &mask, std::vector<cv::
computeDescriptors
(
working_mat
,
integral_image
,
level
,
keypoints
,
desc
);
// Copy to the output data
if
(
!
desc
.
empty
()
)
if
(
level
!=
params_
.
first_level_
)
{
if
(
do_keypoints
)
{
// Rescale the coordinates
if
(
level
!=
params_
.
first_level_
)
{
float
scale
=
std
::
pow
(
params_
.
scale_factor_
,
float
(
level
-
params_
.
first_level_
));
for
(
std
::
vector
<
cv
::
KeyPoint
>::
iterator
keypoint
=
keypoints
.
begin
(),
keypoint_end
=
keypoints
.
end
();
keypoint
!=
keypoint_end
;
++
keypoint
)
keypoint
->
pt
*=
scale
;
}
// And add the keypoints to the output
keypoints_in_out
.
insert
(
keypoints_in_out
.
end
(),
keypoints
.
begin
(),
keypoints
.
end
());
}
float
scale
=
std
::
pow
(
params_
.
scale_factor_
,
float
(
level
-
params_
.
first_level_
));
for
(
std
::
vector
<
cv
::
KeyPoint
>::
iterator
keypoint
=
keypoints
.
begin
(),
keypoint_end
=
keypoints
.
end
();
keypoint
!=
keypoint_end
;
++
keypoint
)
keypoint
->
pt
*=
scale
;
}
// And add the keypoints to the output
keypoints_in_out
.
insert
(
keypoints_in_out
.
end
(),
keypoints
.
begin
(),
keypoints
.
end
());
if
(
do_descriptors
)
{
if
(
descriptors
.
empty
())
desc
.
copyTo
(
descriptors
);
else
descriptors
.
push_back
(
desc
);
}
if
(
do_descriptors
)
{
if
(
descriptors
.
empty
())
desc
.
copyTo
(
descriptors
);
else
descriptors
.
push_back
(
desc
);
}
}
}
...
...
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