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
34a18f79
Commit
34a18f79
authored
Apr 29, 2011
by
Maria Dimashova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed #832
parent
2806db93
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
16 deletions
+11
-16
features2d.hpp
modules/features2d/include/opencv2/features2d/features2d.hpp
+1
-1
descriptors.cpp
modules/features2d/src/descriptors.cpp
+10
-15
No files found.
modules/features2d/include/opencv2/features2d/features2d.hpp
View file @
34a18f79
...
...
@@ -1630,7 +1630,7 @@ protected:
* Remove keypoints within borderPixels of an image edge.
*/
static
void
removeBorderKeypoints
(
vector
<
KeyPoint
>&
keypoints
,
Size
imageSize
,
floa
t
borderSize
);
Size
imageSize
,
in
t
borderSize
);
};
/*
...
...
modules/features2d/src/descriptors.cpp
View file @
34a18f79
...
...
@@ -54,19 +54,15 @@ namespace cv
*/
struct
RoiPredicate
{
RoiPredicate
(
float
_minX
,
float
_minY
,
float
_maxX
,
float
_maxY
)
:
minX
(
_minX
),
minY
(
_minY
),
maxX
(
_maxX
),
maxY
(
_maxY
)
RoiPredicate
(
const
Rect
&
_r
)
:
r
(
_r
)
{}
bool
operator
()(
const
KeyPoint
&
keyPt
)
const
{
Point2f
pt
=
keyPt
.
pt
;
float
eps
=
std
::
numeric_limits
<
float
>::
epsilon
();
return
(
pt
.
x
<
minX
+
eps
)
||
(
pt
.
x
>=
maxX
-
eps
)
||
(
pt
.
y
<
minY
+
eps
)
||
(
pt
.
y
>=
maxY
-
eps
);
return
!
r
.
contains
(
keyPt
.
pt
);
}
float
minX
,
minY
,
maxX
,
maxY
;
Rect
r
;
};
DescriptorExtractor
::~
DescriptorExtractor
()
...
...
@@ -74,14 +70,14 @@ DescriptorExtractor::~DescriptorExtractor()
void
DescriptorExtractor
::
compute
(
const
Mat
&
image
,
vector
<
KeyPoint
>&
keypoints
,
Mat
&
descriptors
)
const
{
if
(
image
.
empty
()
||
keypoints
.
empty
()
)
return
;
if
(
image
.
empty
()
||
keypoints
.
empty
()
)
return
;
// Check keypoints are in image. Do filter bad points here?
// Check keypoints are in image. Do filter bad points here?
//for( size_t i = 0; i < keypoints.size(); i++ )
// CV_Assert( Rect(0,0, image.cols, image.rows).contains(keypoints[i].pt) );
computeImpl
(
image
,
keypoints
,
descriptors
);
computeImpl
(
image
,
keypoints
,
descriptors
);
}
void
DescriptorExtractor
::
compute
(
const
vector
<
Mat
>&
imageCollection
,
vector
<
vector
<
KeyPoint
>
>&
pointCollection
,
vector
<
Mat
>&
descCollection
)
const
...
...
@@ -104,14 +100,13 @@ bool DescriptorExtractor::empty() const
}
void
DescriptorExtractor
::
removeBorderKeypoints
(
vector
<
KeyPoint
>&
keypoints
,
Size
imageSize
,
floa
t
borderSize
)
Size
imageSize
,
in
t
borderSize
)
{
if
(
borderSize
>
0
)
{
keypoints
.
erase
(
remove_if
(
keypoints
.
begin
(),
keypoints
.
end
(),
RoiPredicate
(
borderSize
,
borderSize
,
(
float
)
imageSize
.
width
-
borderSize
,
(
float
)
imageSize
.
height
-
borderSize
)),
RoiPredicate
(
Rect
(
Point
(
borderSize
,
borderSize
),
Point
(
imageSize
.
width
-
borderSize
,
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