Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
J
jfx_kalman_filter_src
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
oscar
jfx_kalman_filter_src
Commits
ea5b4b3e
Commit
ea5b4b3e
authored
Dec 24, 2021
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交更新
parent
8fba9e55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
Track3D.cpp
BaseTracker/Track3D.cpp
+5
-3
No files found.
BaseTracker/Track3D.cpp
View file @
ea5b4b3e
...
...
@@ -219,17 +219,19 @@ int Track3D::GetKFDataOrder(std::vector<int>& order)
const
float
ANGLE_CHANGE_MAX
=
30
/
180
*
_PI_
;
double
correct_angle
(
std
::
queue
<
point2d
>&
m_
points
)
double
correct_angle
(
std
::
queue
<
point2d
>&
points
)
{
if
(
m_points
.
size
()
<
5
)
return
0
;
Eigen
::
MatrixXd
X
(
5
,
2
);
// 输入直线 y=x 上的三个点
// 坐标 (1, 1), (2, 2), (3, 3)
std
::
queue
<
point2d
>
tmppoints
=
points
;
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
point2d
pos
=
m_points
.
pop
();
point2d
pos
=
tmppoints
.
front
();
X
(
i
,
0
)
=
pos
.
x
;
X
(
i
,
1
)
=
pos
.
y
;
tmppoints
.
pop
();
}
Eigen
::
MatrixXd
X_copy
=
X
;
// 拷贝副本,因为X取均值后会被改变
Eigen
::
MatrixXd
C
(
2
,
2
);
// 方差
...
...
@@ -242,7 +244,7 @@ double correct_angle(std::queue<point2d>& m_points)
C
=
X
.
adjoint
()
*
X
;
C
=
C
.
array
()
/
(
X
.
rows
()
-
1
);
// 计算特征值和特征向量
SelfAdjointEigenSolver
<
MatrixXd
>
eig
(
C
);
// 产生的vec和val按照特征值升序排列
Eigen
::
SelfAdjointEigenSolver
<
MatrixXd
>
eig
(
C
);
// 产生的vec和val按照特征值升序排列
vec
=
eig
.
eigenvectors
();
val
=
eig
.
eigenvalues
();
// 打印
...
...
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