Changeset View
Changeset View
Standalone View
Standalone View
libmv/autotrack/predict_tracks.h
| Context not available. | |||||
| #ifndef LIBMV_AUTOTRACK_PREDICT_TRACKS_H_ | #ifndef LIBMV_AUTOTRACK_PREDICT_TRACKS_H_ | ||||
| #define LIBMV_AUTOTRACK_PREDICT_TRACKS_H_ | #define LIBMV_AUTOTRACK_PREDICT_TRACKS_H_ | ||||
| #include "libmv/tracking/kalman_filter.h" | |||||
| #include "libmv/autotrack/marker.h" | |||||
| namespace mv { | namespace mv { | ||||
| class Tracks; | class Tracks; | ||||
| struct Marker; | struct Marker; | ||||
| typedef mv::KalmanFilter<double, 6, 2> TrackerKalman; | |||||
| class KalmanFilterState { | |||||
| TrackerKalman::State _state; | |||||
| int _stateFrame; | |||||
| bool _hasInitializedState; | |||||
| int _frameStep; | |||||
| Marker _previousMarker; | |||||
| public: | |||||
| KalmanFilterState() : _state(), _stateFrame(0), _hasInitializedState(false), _frameStep(1), _previousMarker() {} | |||||
| // Initialize the Kalman state. | |||||
| void Init(const Marker& first_marker, int frameStep); | |||||
| // predict forward until target_frame is reached | |||||
| bool PredictForward(const int target_frame, | |||||
| Marker* predicted_marker); | |||||
| // returns true if update was succesful | |||||
| bool Update(const Marker& measured_marker); | |||||
| }; | |||||
| // Predict the position of the given marker, and update it accordingly. The | // Predict the position of the given marker, and update it accordingly. The | ||||
| // existing position will be overwritten. | // existing position will be overwritten. | ||||
| bool PredictMarkerPosition(const Tracks& tracks, Marker* marker); | bool PredictMarkerPosition(const Tracks& tracks, Marker* marker); | ||||
| Context not available. | |||||