Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
ddaefb6c
Commit
ddaefb6c
authored
Feb 18, 2013
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed how the surf descriptor is computed slightly to improve its accuracy.
parent
439888e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
surf.h
dlib/image_keypoint/surf.h
+9
-7
surf_abstract.h
dlib/image_keypoint/surf_abstract.h
+2
-2
No files found.
dlib/image_keypoint/surf.h
View file @
ddaefb6c
...
...
@@ -93,6 +93,8 @@ namespace dlib
std
::
vector
<
double
>
ang
;
std
::
vector
<
dlib
::
vector
<
double
,
2
>
>
samples
;
const
long
sc
=
static_cast
<
long
>
(
scale
+
0
.
5
);
// accumulate a bunch of angle and vector samples
dlib
::
vector
<
double
,
2
>
vect
;
for
(
long
r
=
-
6
;
r
<=
6
;
++
r
)
...
...
@@ -103,8 +105,8 @@ namespace dlib
{
// compute a Gaussian weighted gradient and the gradient's angle.
const
double
gauss
=
gaussian
(
c
,
r
,
2
.
5
);
vect
.
x
()
=
gauss
*
haar_x
(
img
,
sc
ale
*
point
(
c
,
r
)
+
center
,
static_cast
<
long
>
(
4
*
scale
+
0
.
5
)
);
vect
.
y
()
=
gauss
*
haar_y
(
img
,
sc
ale
*
point
(
c
,
r
)
+
center
,
static_cast
<
long
>
(
4
*
scale
+
0
.
5
)
);
vect
.
x
()
=
gauss
*
haar_x
(
img
,
sc
*
point
(
c
,
r
)
+
center
,
4
*
sc
);
vect
.
y
()
=
gauss
*
haar_y
(
img
,
sc
*
point
(
c
,
r
)
+
center
,
4
*
sc
);
samples
.
push_back
(
vect
);
ang
.
push_back
(
atan2
(
vect
.
y
(),
vect
.
x
()));
}
...
...
@@ -163,7 +165,7 @@ namespace dlib
matrix
<
double
,
64
,
1
,
MM
,
L
>&
des
)
{
DLIB_ASSERT
(
get_rect
(
img
).
contains
(
centered_rect
(
center
,
(
unsigned
long
)(
3
1
*
scale
),(
unsigned
long
)(
31
*
scale
)))
==
true
&&
DLIB_ASSERT
(
get_rect
(
img
).
contains
(
centered_rect
(
center
,
(
unsigned
long
)(
3
2
*
scale
),(
unsigned
long
)(
32
*
scale
)))
==
true
&&
scale
>
0
,
"
\t
void compute_surf_descriptor(img, center, scale, angle)"
<<
"
\n\t
All arguments to this function must be > 0"
...
...
@@ -175,6 +177,7 @@ namespace dlib
point_rotator
rot
(
angle
);
point_rotator
inv_rot
(
-
angle
);
const
long
sc
=
static_cast
<
long
>
(
scale
+
0
.
5
);
long
count
=
0
;
// loop over the 4x4 grid of histogram buckets
...
...
@@ -192,9 +195,8 @@ namespace dlib
// get the rotated point for this extraction point
point
p
(
rot
(
point
(
x
,
y
)
*
scale
)
+
center
);
const
double
gauss
=
gaussian
(
x
,
y
,
3
.
3
);
temp
.
x
()
=
gauss
*
haar_x
(
img
,
p
,
static_cast
<
long
>
(
2
*
scale
+
0
.
5
));
temp
.
y
()
=
gauss
*
haar_y
(
img
,
p
,
static_cast
<
long
>
(
2
*
scale
+
0
.
5
));
temp
.
x
()
=
haar_x
(
img
,
p
,
2
*
sc
);
temp
.
y
()
=
haar_y
(
img
,
p
,
2
*
sc
);
// rotate this vector into alignment with the surf descriptor box
temp
=
inv_rot
(
temp
);
...
...
@@ -252,7 +254,7 @@ namespace dlib
for
(
unsigned
long
i
=
0
;
i
<
std
::
min
((
size_t
)
max_points
,
points
.
size
());
++
i
)
{
// ignore points that are close to the edge of the image
const
double
border
=
3
1
;
const
double
border
=
3
2
;
const
unsigned
long
border_size
=
static_cast
<
unsigned
long
>
(
border
*
points
[
i
].
scale
);
if
(
get_rect
(
int_img
).
contains
(
centered_rect
(
points
[
i
].
center
,
border_size
,
border_size
)))
{
...
...
dlib/image_keypoint/surf_abstract.h
View file @
ddaefb6c
...
...
@@ -76,8 +76,8 @@ namespace dlib
- integral_image_type == an object such as dlib::integral_image or another
type that implements the interface defined in image_transforms/integral_image_abstract.h
- scale > 0
- get_rect(img).contains(centered_rect(center, 3
1*scale, 31
*scale)) == true
(i.e. center can't be within 3
1
*scale pixels of the edge of the image)
- get_rect(img).contains(centered_rect(center, 3
2*scale, 32
*scale)) == true
(i.e. center can't be within 3
2
*scale pixels of the edge of the image)
ensures
- computes the 64 dimensional SURF descriptor vector of a box centered
at the given center point, tilted at an angle determined by the given
...
...
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