Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
6132943a
Commit
6132943a
authored
Nov 09, 2018
by
Alexander Alekhin
Committed by
Alexander Alekhin
Nov 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xfeatures2d: validate keypoints mask for SURF
parent
25ded913
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
surf.cpp
modules/xfeatures2d/src/surf.cpp
+13
-0
No files found.
modules/xfeatures2d/src/surf.cpp
View file @
6132943a
...
...
@@ -944,6 +944,19 @@ void SURF_Impl::detectAndCompute(InputArray _img, InputArray _mask,
integral
(
mask1
,
msum
,
CV_32S
);
}
fastHessianDetector
(
sum
,
msum
,
keypoints
,
nOctaves
,
nOctaveLayers
,
(
float
)
hessianThreshold
);
if
(
!
mask
.
empty
())
{
for
(
size_t
i
=
0
;
i
<
keypoints
.
size
();
)
{
Point
pt
(
keypoints
[
i
].
pt
);
if
(
mask
.
at
<
uchar
>
(
pt
.
y
,
pt
.
x
)
==
0
)
{
keypoints
.
erase
(
keypoints
.
begin
()
+
i
);
continue
;
// keep "i"
}
i
++
;
}
}
}
int
i
,
j
,
N
=
(
int
)
keypoints
.
size
();
...
...
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