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
c562d791
Commit
c562d791
authored
Jan 31, 2011
by
Maria Dimashova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed border type to float
parent
fd1f644e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
descriptors.cpp
modules/features2d/src/descriptors.cpp
+9
-7
No files found.
modules/features2d/src/descriptors.cpp
View file @
c562d791
...
...
@@ -54,14 +54,16 @@ namespace cv
*/
struct
RoiPredicate
{
RoiPredicate
(
float
_minX
,
float
_minY
,
float
_maxX
,
float
_maxY
)
RoiPredicate
(
float
_minX
,
float
_minY
,
float
_maxX
,
float
_maxY
)
:
minX
(
_minX
),
minY
(
_minY
),
maxX
(
_maxX
),
maxY
(
_maxY
)
{}
bool
operator
()(
const
KeyPoint
&
keyPt
)
const
bool
operator
()(
const
KeyPoint
&
keyPt
)
const
{
Point2f
pt
=
keyPt
.
pt
;
return
(
pt
.
x
<
minX
)
||
(
pt
.
x
>=
maxX
)
||
(
pt
.
y
<
minY
)
||
(
pt
.
y
>=
maxY
);
float
eps
=
std
::
numeric_limits
<
float
>::
epsilon
();
return
(
pt
.
x
<
minX
+
eps
)
||
(
pt
.
x
>=
maxX
-
eps
)
||
(
pt
.
y
<
minY
+
eps
)
||
(
pt
.
y
>=
maxY
-
eps
);
}
float
minX
,
minY
,
maxX
,
maxY
;
...
...
@@ -102,14 +104,14 @@ bool DescriptorExtractor::empty() const
}
void
DescriptorExtractor
::
removeBorderKeypoints
(
vector
<
KeyPoint
>&
keypoints
,
Size
imageSize
,
in
t
borderSize
)
Size
imageSize
,
floa
t
borderSize
)
{
if
(
borderSize
>
0
)
{
keypoints
.
erase
(
remove_if
(
keypoints
.
begin
(),
keypoints
.
end
(),
RoiPredicate
(
(
float
)
borderSize
,
(
float
)
borderSize
,
(
float
)
(
imageSize
.
width
-
borderSize
)
,
(
float
)
(
imageSize
.
height
-
borderSize
)
)),
RoiPredicate
(
borderSize
,
borderSize
,
(
float
)
imageSize
.
width
-
borderSize
,
(
float
)
imageSize
.
height
-
borderSize
)),
keypoints
.
end
()
);
}
}
...
...
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