#include <tracks.h>
Classes | |
struct | frame_iterator |
Frame iterator. More... | |
struct | keypoint_match_iterator |
Temporal iterator for keypoints with a track. More... | |
Public Types | |
typedef bucket2d< tkeypoint > ::iterator | keypoint_frame_iterator |
Spacial iterator for keypoints within a frame. | |
Public Member Functions | |
tracks (tkeypoint::factory_t *kf=0, tframe::factory_t *ff=0, ttrack::factory_t *tf=0) | |
tracks constructor. | |
~tracks () | |
void | set_match (tkeypoint *prev, tkeypoint *next) |
Connects "prev" with "next". Both points must be on consecutive frames. | |
void | unset_match (tkeypoint *k) |
Disconnects k and k->matches.prev. | |
frame_iterator | get_nth_frame_it (int n) |
Get a frame iterator for the Nth last frame. n=0 returns the most recent frame. | |
tframe * | get_nth_frame (int n) |
returns a pointer to the Nth last frame. 0 returns the most recent frame. | |
void | remove_point_track (tkeypoint *point) |
Delete all the keypoints stored in the linked list 'prev_frame'. | |
void | remove_track_tail (tkeypoint *point) |
removes "point" and all its previous correspondences. | |
void | remove_unmatched_tracks (frame_iterator frame_it) |
removes all tracks that do not have a valid point->matches.next pointer. | |
void | remove_empty_frames () |
Removes all frames that do not contain any keypoint. | |
void | remove_frame (frame_iterator &f) |
Removes the frame pointed by frame iterator f. | |
void | remove_frame (tframe *frame) |
Removes the frame pointed by frame. | |
Public Attributes | |
tframe * | frames |
ttrack * | all_tracks |
tkeypoint::factory_t * | keypoint_factory |
tframe::factory_t * | tframe_factory |
ttrack::factory_t * | ttrack_factory |
The tracks class can be viewed as a sparse matrix whose columns are made of frame and whose rows are tracks of points. The matrix is stored in a sparse manner. Access to elements is done through iterators. Point access can be achieved by:
This class provides only storage. The actual tracking is the user's responsability.
Definition at line 187 of file tracks.h.
typedef bucket2d<tkeypoint>::iterator tracks::keypoint_frame_iterator |
tracks::tracks | ( | tkeypoint::factory_t * | kf = 0 , |
|
tframe::factory_t * | ff = 0 , |
|||
ttrack::factory_t * | tf = 0 | |||
) |
tracks constructor.
Takes factories for tkeypoint, tframe and ttrack as arguments. This way, the user can use derived classes.
Definition at line 116 of file tracks.cpp.
References keypoint_factory, tframe_factory, and ttrack_factory.
tracks::~tracks | ( | ) |
tframe * tracks::get_nth_frame | ( | int | n | ) |
returns a pointer to the Nth last frame. 0 returns the most recent frame.
Definition at line 144 of file tracks.cpp.
References tracks::frame_iterator::frame, and get_nth_frame_it().
Referenced by kpt_tracker::create_frame(), pic_randomizer::group_ids(), vobj_tracker_view::keyPressEvent(), VSView::keyPressEvent(), main(), vobj_tracker_view::paintGL(), VSView::paintGL(), vobj_tracker::process_frame(), kpt_tracker::process_frame(), vobj_tracker::process_frame_pipeline(), kpt_tracker::process_frame_pipeline(), pic_randomizer::save_keypoints(), VSView::segment_scene(), vobj_tracker_view::timerEvent(), and VSView::timerEvent().
tracks::frame_iterator tracks::get_nth_frame_it | ( | int | n | ) |
Get a frame iterator for the Nth last frame. n=0 returns the most recent frame.
Definition at line 135 of file tracks.cpp.
References tracks::frame_iterator::end().
Referenced by get_nth_frame(), VSView::segment_scene(), vobj_tracker_view::timerEvent(), and VSView::timerEvent().
void tracks::remove_empty_frames | ( | ) |
Removes all frames that do not contain any keypoint.
Definition at line 192 of file tracks.cpp.
References tracks::frame_iterator::end(), tracks::frame_iterator::frame, tframe::points, remove_frame(), and bucket2d< T >::size().
Referenced by remove_unmatched_tracks().
void tracks::remove_frame | ( | tframe * | frame | ) |
Removes the frame pointed by frame.
Definition at line 211 of file tracks.cpp.
References bucket2d< T >::begin(), tframe::factory_t::destroy(), frames, MLIST_RM, tframe::points, remove_track_tail(), bucket2d< T >::size(), and tframe_factory.
void tracks::remove_frame | ( | frame_iterator & | f | ) |
Removes the frame pointed by frame iterator f.
Definition at line 205 of file tracks.cpp.
References tracks::frame_iterator::end(), and tracks::frame_iterator::frame.
Referenced by pic_randomizer::group_ids(), remove_empty_frames(), pic_randomizer::save_keypoints(), VSView::segment_scene(), vobj_tracker_view::timerEvent(), VSView::timerEvent(), and ~tracks().
void tracks::remove_point_track | ( | tkeypoint * | point | ) |
Delete all the keypoints stored in the linked list 'prev_frame'.
Fixes prev_in_frame/next_in_frame linked list.
Definition at line 149 of file tracks.cpp.
References tkeypoint::dispose(), tkeypoint::matches, mlist_elem< T >::next, and mlist_elem< T >::prev.
Referenced by remove_track_tail(), and remove_unmatched_tracks().
void tracks::remove_track_tail | ( | tkeypoint * | point | ) |
removes "point" and all its previous correspondences.
Definition at line 165 of file tracks.cpp.
References tkeypoint::dispose(), tkeypoint::matches, mlist_elem< T >::prev, and remove_point_track().
Referenced by remove_frame().
void tracks::remove_unmatched_tracks | ( | frame_iterator | frame_it | ) |
removes all tracks that do not have a valid point->matches.next pointer.
Definition at line 171 of file tracks.cpp.
References bucket2d< T >::begin(), tracks::frame_iterator::end(), tracks::frame_iterator::frame, tkeypoint::matches, mlist_elem< T >::next, tframe::points, remove_empty_frames(), and remove_point_track().
Referenced by kpt_tracker::clear(), main(), vobj_tracker_view::timerEvent(), and VSView::timerEvent().
Connects "prev" with "next". Both points must be on consecutive frames.
Definition at line 37 of file tracks.cpp.
References all_tracks, ttrack::factory_t::create(), ttrack::keypoints, tkeypoint::matches, MLIST_INSERT, mlist_elem< T >::next, ttrack::point_added(), mlist_elem< T >::prev, tkeypoint::track, and ttrack_factory.
Referenced by kpt_tracker::track_ncclk().
void tracks::unset_match | ( | tkeypoint * | k | ) |
Disconnects k and k->matches.prev.
Definition at line 59 of file tracks.cpp.
References all_tracks, ttrack::factory_t::destroy(), ttrack::keypoints, tkeypoint::matches, MLIST_RM, ttrack::point_removed(), mlist_elem< T >::prev, RLIST_RM, tkeypoint::track, and ttrack_factory.
Referenced by kpt_tracker::track_ncclk().
Definition at line 255 of file tracks.h.
Referenced by VSView::segment_scene(), set_match(), tkeypoint::unlink(), unset_match(), and update_query_with_frame().
Definition at line 254 of file tracks.h.
Referenced by tframe::append_to(), kpt_tracker::clear(), tracks::frame_iterator::frame_iterator(), remove_frame(), update_query_with_frame(), and ~tracks().
Definition at line 258 of file tracks.h.
Referenced by kpt_tracker::create_frame(), remove_frame(), and tracks().
Definition at line 259 of file tracks.h.
Referenced by set_match(), tracks(), tkeypoint::unlink(), and unset_match().