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
9b87c22e
Commit
9b87c22e
authored
May 01, 2015
by
cbalint13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bugs in non-max suppression routine.
parent
bbdf2167
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
agast.cpp
modules/features2d/src/agast.cpp
+12
-8
No files found.
modules/features2d/src/agast.cpp
View file @
9b87c22e
...
...
@@ -7565,19 +7565,16 @@ void AGAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, boo
size_t
lastRowCorner_ind
=
0
,
next_lastRowCorner_ind
=
0
;
std
::
vector
<
int
>
nmsFlags
;
std
::
vector
<
int
>::
iterator
nmsFlags_p
;
std
::
vector
<
KeyPoint
>::
iterator
currCorner_nms
;
std
::
vector
<
KeyPoint
>::
const_iterator
currCorner
;
currCorner
=
keypoints
.
begin
();
nmsFlags
.
resize
((
int
)
num_Corners
);
nmsFlags_p
=
nmsFlags
.
begin
();
// set all flags to MAXIMUM
for
(
j
=
num_Corners
;
j
>
0
;
j
--
)
*
nmsFlags_p
++
=
-
1
;
nmsFlags_p
=
nmsFlags
.
begin
();
for
(
j
=
0
;
j
<
num_Corners
;
j
++
)
nmsFlags
[
j
]
=
-
1
;
for
(
curr_idx
=
0
;
curr_idx
<
num_Corners
;
curr_idx
++
)
{
...
...
@@ -7655,11 +7652,18 @@ void AGAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, boo
currCorner
++
;
}
//
removing
non-maximum corners
//
mark
non-maximum corners
for
(
curr_idx
=
0
;
curr_idx
<
num_Corners
;
curr_idx
++
)
{
if
(
*
nmsFlags_p
++
!=
-
1
)
keypoints
.
erase
(
keypoints
.
begin
()
+
curr_idx
);
if
(
nmsFlags
[
curr_idx
]
!=
-
1
)
keypoints
[
curr_idx
].
response
=
-
1
;
}
// erase non-maximum corners
for
(
j
=
keypoints
.
size
();
j
>
0
;
j
--
)
{
if
(
keypoints
[
j
-
1
].
response
==
-
1
)
keypoints
.
erase
(
keypoints
.
begin
()
+
j
-
1
);
}
}
}
...
...
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