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
fe7ea32a
Commit
fe7ea32a
authored
Feb 02, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Gaussian windowing to max_point_interpolated().
parent
fa148f32
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
matrix_la.h
dlib/matrix/matrix_la.h
+23
-6
No files found.
dlib/matrix/matrix_la.h
View file @
fe7ea32a
...
...
@@ -1885,6 +1885,8 @@ convergence:
if
(
shrink_rect
(
get_rect
(
m
),
1
).
contains
(
p
)
==
false
)
return
p
;
//matrix<double> A(9,6);
//matrix<double,0,1> G(9);
matrix
<
double
,
9
,
1
>
pix
;
long
i
=
0
;
...
...
@@ -1893,22 +1895,37 @@ convergence:
for
(
long
c
=
-
1
;
c
<=
+
1
;
++
c
)
{
pix
(
i
)
=
dlib
::
impl
::
magnitude
(
m
(
p
.
y
()
+
r
,
p
.
y
()
+
c
));
/*
A(i,0) = c*c;
A(i,1) = c*r;
A(i,2) = r*r;
A(i,3) = c;
A(i,4) = r;
A(i,5) = 1;
G(i) = std::exp(-1*(r*r+c*c)/2.0); // Use a gaussian windowing function around p.
*/
++
i
;
}
}
// This bit of code is how we generated the magic matrix below.
//A = diagm(G)*A;
//std::cout << std::setprecision(16) << inv(trans(A)*A)*trans(A)*diagm(G) << std::endl; exit(1);
// So this magic finds the parameters of the quadratic surface that best fits
// the 3x3 region around p. Then we find the maximizer of that surface within that
// small region and return that as the maximum location.
const
double
magic
[]
=
{
12
,
-
24
,
12
,
12
,
-
24
,
12
,
12
,
-
24
,
12
,
9
,
0
,
-
9
,
0
,
0
,
0
,
-
9
,
0
,
9
,
12
,
12
,
12
,
-
24
,
-
24
,
-
24
,
12
,
12
,
12
,
-
12
,
0
,
12
,
-
12
,
0
,
12
,
-
12
,
0
,
12
,
-
12
,
-
12
,
-
12
,
0
,
0
,
0
,
12
,
12
,
12
};
{
0
.
1059707788085427
,
-
0
.
2119415576170854
,
0
.
1059707788085427
,
0
.
2880584423829146
,
-
0
.
5761168847658288
,
0
.
2880584423829146
,
0
.
1059707788085427
,
-
0
.
2119415576170854
,
0
.
1059707788085427
,
0
.
25
,
0
,
-
0
.
25
,
0
,
0
,
0
,
-
0
.
25
,
0
,
0
.
25
,
0
.
1059707788085427
,
0
.
2880584423829145
,
0
.
1059707788085427
,
-
0
.
2119415576170854
,
-
0
.
5761168847658289
,
-
0
.
2119415576170854
,
0
.
1059707788085427
,
0
.
2880584423829145
,
0
.
1059707788085427
,
-
0
.
1059707788085427
,
0
,
0
.
1059707788085427
,
-
0
.
2880584423829145
,
0
,
0
.
2880584423829145
,
-
0
.
1059707788085427
,
0
,
0
.
1059707788085427
,
-
0
.
1059707788085427
,
-
0
.
2880584423829145
,
-
0
.
1059707788085427
,
0
,
0
,
0
,
0
.
1059707788085427
,
0
.
2880584423829145
,
0
.
1059707788085427
,
};
const
matrix
<
double
,
5
,
9
>
mag
(
magic
);
// Now w contains the parameters of the quadratic surface
const
matrix
<
double
,
5
,
1
>
w
=
mag
*
pix
/
72
;
const
matrix
<
double
,
5
,
1
>
w
=
mag
*
pix
;
// Now newton step to the max point on the surface
...
...
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