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
af2af3af
Commit
af2af3af
authored
May 31, 2011
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added KeyPoint::hash() (ticket #1100)
parent
63dc1cdd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
features2d.hpp
modules/features2d/include/opencv2/features2d/features2d.hpp
+4
-1
keypoint.cpp
modules/features2d/src/keypoint.cpp
+14
-1
No files found.
modules/features2d/include/opencv2/features2d/features2d.hpp
View file @
af2af3af
...
@@ -236,6 +236,9 @@ public:
...
@@ -236,6 +236,9 @@ public:
float
_response
=
0
,
int
_octave
=
0
,
int
_class_id
=-
1
)
float
_response
=
0
,
int
_octave
=
0
,
int
_class_id
=-
1
)
:
pt
(
x
,
y
),
size
(
_size
),
angle
(
_angle
),
:
pt
(
x
,
y
),
size
(
_size
),
angle
(
_angle
),
response
(
_response
),
octave
(
_octave
),
class_id
(
_class_id
)
{}
response
(
_response
),
octave
(
_octave
),
class_id
(
_class_id
)
{}
size_t
hash
()
const
;
//! converts vector of keypoints to vector of points
//! converts vector of keypoints to vector of points
static
void
convert
(
const
std
::
vector
<
KeyPoint
>&
keypoints
,
static
void
convert
(
const
std
::
vector
<
KeyPoint
>&
keypoints
,
CV_OUT
std
::
vector
<
Point2f
>&
points2f
,
CV_OUT
std
::
vector
<
Point2f
>&
points2f
,
...
@@ -257,7 +260,7 @@ public:
...
@@ -257,7 +260,7 @@ public:
CV_PROP_RW
int
octave
;
//!< octave (pyramid layer) from which the keypoint has been extracted
CV_PROP_RW
int
octave
;
//!< octave (pyramid layer) from which the keypoint has been extracted
CV_PROP_RW
int
class_id
;
//!< object class (if the keypoints need to be clustered by an object they belong to)
CV_PROP_RW
int
class_id
;
//!< object class (if the keypoints need to be clustered by an object they belong to)
};
};
//! writes vector of keypoints to the file storage
//! writes vector of keypoints to the file storage
CV_EXPORTS
void
write
(
FileStorage
&
fs
,
const
string
&
name
,
const
vector
<
KeyPoint
>&
keypoints
);
CV_EXPORTS
void
write
(
FileStorage
&
fs
,
const
string
&
name
,
const
vector
<
KeyPoint
>&
keypoints
);
//! reads vector of keypoints from the specified file storage node
//! reads vector of keypoints from the specified file storage node
...
...
modules/features2d/src/keypoint.cpp
View file @
af2af3af
...
@@ -43,7 +43,20 @@
...
@@ -43,7 +43,20 @@
namespace
cv
namespace
cv
{
{
size_t
KeyPoint
::
hash
()
const
{
size_t
_Val
=
2166136261U
,
scale
=
16777619U
;
Cv32suf
u
;
u
.
f
=
pt
.
x
;
_Val
=
(
scale
*
_Val
)
^
u
.
u
;
u
.
f
=
pt
.
y
;
_Val
=
(
scale
*
_Val
)
^
u
.
u
;
u
.
f
=
size
;
_Val
=
(
scale
*
_Val
)
^
u
.
u
;
u
.
f
=
angle
;
_Val
=
(
scale
*
_Val
)
^
u
.
u
;
u
.
f
=
response
;
_Val
=
(
scale
*
_Val
)
^
u
.
u
;
_Val
=
(
scale
*
_Val
)
^
((
size_t
)
octave
);
_Val
=
(
scale
*
_Val
)
^
((
size_t
)
class_id
);
return
_Val
;
}
void
write
(
FileStorage
&
fs
,
const
string
&
objname
,
const
vector
<
KeyPoint
>&
keypoints
)
void
write
(
FileStorage
&
fs
,
const
string
&
objname
,
const
vector
<
KeyPoint
>&
keypoints
)
{
{
...
...
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