Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
J
jfx_vision_new
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_vision_new
Commits
68fd41ed
Commit
68fd41ed
authored
Mar 30, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交更新
parent
b9bb53c6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
BaseTrack.h
src/BaseTracker/BaseTrack.h
+1
-1
Track2D.cpp
src/BaseTracker/Track2D.cpp
+1
-1
kalman_filter_f.cpp
src/BaseTracker/kalman_filter_f.cpp
+6
-6
kalman_filter_f.h
src/BaseTracker/kalman_filter_f.h
+3
-3
No files found.
src/BaseTracker/BaseTrack.h
View file @
68fd41ed
...
...
@@ -63,5 +63,5 @@ public:
int
m_updateValidCount
=
3
;
//更新多少次认为是一个有效数据。
std
::
shared_ptr
<
mytracker_f
::
KalmanFilter
>
kf_
=
nullptr
;
std
::
shared_ptr
<
mytracker_f
::
KalmanFilter
_f
>
kf_
=
nullptr
;
};
src/BaseTracker/Track2D.cpp
View file @
68fd41ed
...
...
@@ -3,7 +3,7 @@
Track2D
::
Track2D
()
:
BaseTrack
(
8
,
4
)
{
std
::
shared_ptr
<
mytracker_f
::
KalmanFilter
>
kf
=
std
::
make_shared
<
mytracker
::
KalmanFilter
>
(
8
,
4
);
std
::
shared_ptr
<
mytracker_f
::
KalmanFilter
_f
>
kf
=
std
::
make_shared
<
mytracker_f
::
KalmanFilter_f
>
(
8
,
4
);
kf
->
F_
<<
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
...
...
src/BaseTracker/kalman_filter_f.cpp
View file @
68fd41ed
...
...
@@ -2,7 +2,7 @@
namespace
mytracker_f
{
KalmanFilter
::
KalmanFilter
(
unsigned
int
num_states
,
unsigned
int
num_obs
)
:
KalmanFilter
_f
::
KalmanFilter_f
(
unsigned
int
num_states
,
unsigned
int
num_obs
)
:
num_states_
(
num_states
),
num_obs_
(
num_obs
)
{
/*** Predict ***/
// State vector
...
...
@@ -33,25 +33,25 @@ KalmanFilter::KalmanFilter(unsigned int num_states, unsigned int num_obs) :
}
void
KalmanFilter
::
Coast
()
{
void
KalmanFilter
_f
::
Coast
()
{
x_predict_
=
F_
*
x_
;
P_predict_
=
F_
*
P_
*
F_
.
transpose
()
+
Q_
;
}
void
KalmanFilter
::
Predict
()
{
void
KalmanFilter
_f
::
Predict
()
{
Coast
();
x_
=
x_predict_
;
P_
=
P_predict_
;
}
Eigen
::
VectorXf
KalmanFilter
::
PredictionToObservation
(
const
Eigen
::
VectorXf
&
state
)
{
Eigen
::
VectorXf
KalmanFilter
_f
::
PredictionToObservation
(
const
Eigen
::
VectorXf
&
state
)
{
return
(
H_
*
state
);
}
void
KalmanFilter
::
Update
(
const
Eigen
::
VectorXf
&
z
)
{
void
KalmanFilter
_f
::
Update
(
const
Eigen
::
VectorXf
&
z
)
{
Eigen
::
VectorXf
z_predict
=
PredictionToObservation
(
x_predict_
);
// y - innovation, z - real observation, z_predict - predicted observation
...
...
@@ -98,7 +98,7 @@ void KalmanFilter::Update(const Eigen::VectorXf& z) {
}
float
KalmanFilter
::
CalculateLogLikelihood
(
const
Eigen
::
VectorXf
&
y
,
const
Eigen
::
MatrixXf
&
S
)
{
float
KalmanFilter
_f
::
CalculateLogLikelihood
(
const
Eigen
::
VectorXf
&
y
,
const
Eigen
::
MatrixXf
&
S
)
{
float
log_likelihood
;
// Note: Computing log(M.determinant()) in Eigen C++ is risky for large matrices since it may overflow or underflow.
...
...
src/BaseTracker/kalman_filter_f.h
View file @
68fd41ed
...
...
@@ -7,7 +7,7 @@ namespace mytracker_f {
// abstract class for Kalman filter
// implementation could be KF/EKF/UKF...
class
KalmanFilter
{
class
KalmanFilter
_f
{
public
:
/**
* user need to define H matrix & R matrix
...
...
@@ -15,10 +15,10 @@ public:
* @param num_obs
*/
// constructor
explicit
KalmanFilter
(
unsigned
int
num_states
,
unsigned
int
num_obs
);
explicit
KalmanFilter
_f
(
unsigned
int
num_states
,
unsigned
int
num_obs
);
// destructor
virtual
~
KalmanFilter
()
=
default
;
virtual
~
KalmanFilter
_f
()
=
default
;
/**
* Coast state and state covariance using the process model
...
...
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