#include <brct_epi_reconstructor.h>
Definition at line 49 of file brct_epi_reconstructor.h.
Public Member Functions | |
| void | write_results (const char *fname) |
| write result of a frame into a file. | |
| vgl_point_2d< double > | get_cur_epipole () const |
| vcl_vector< vnl_matrix< double > > | get_back_projection () const |
| get backprojection for debugging. | |
| vnl_matrix< double > | get_predicted_curve () |
| predict next curve. | |
| vnl_double_3 | get_next_motion (vnl_double_3 v) |
| vcl_vector< vgl_point_2d< double > > | get_pre_observes () |
| vcl_vector< vgl_point_2d< double > > | get_cur_observes () |
| vcl_vector< vgl_point_2d< double > > | get_next_observes () |
| vcl_vector< vgl_point_2d< double > > | get_joe_pre_observes () |
| vcl_vector< vgl_point_2d< double > > | get_joe_cur_observes () |
| vcl_vector< vgl_point_2d< double > > | get_joe_next_observes () |
| vcl_vector< vgl_point_3d< double > > | get_local_pts () |
| bugl_curve_3d | get_curve_3d () |
| void | read_data (const char *fname) |
| read all the data including time stamps and tracks. | |
| vcl_vector< vdgl_digital_curve_sptr > | read_track_file (char *fname) |
| read vishual tracker result out of a file. | |
| void | init () |
| initialize the kalman filter states. | |
| void | init_epipole (double x, double y) |
| void | inc () |
| vnl_double_2 | projection (const vnl_double_3x4 &P, const vnl_double_3 &X) |
| brct_epi_reconstructor () | |
| constructors. | |
| brct_epi_reconstructor (const char *fname) | |
| virtual | ~brct_epi_reconstructor () |
| void | add_track (vcl_vector< vdgl_digital_curve_sptr > const &track) |
| direct access. | |
| void | print_track (const int track_index, const int frame) |
| print track data. | |
| void | print_motion_array () |
| print motion grouping histogram. | |
Protected Member Functions | |
| vcl_vector< double > | read_timestamp_file (char *fname) |
| read time stamp. | |
| double | matched_point_prob (vnl_double_2 &z, vnl_double_2 &z_pred) |
| if the zero probability returned, the matched point is a outlier. | |
| vnl_matrix_fixed< double, 6, 6 > | get_transit_matrix (int i, int j) |
| get time interval from ith frame to j-th frame. | |
| void | update_confidence () |
| update the confidence for each 3d point. | |
| void | update_observes (const vnl_double_3x4 &P, int iframe) |
| update the matched points in the next frame using closest neighbour. | |
| void | update_observes_joe (int iframe) |
| void | init_velocity () |
| Use the initial epipole to specify the velocity at the first time step. | |
| vnl_matrix_fixed< double, 2, 6 > | get_H_matrix (vnl_double_3x4 &P, vnl_double_3 &Y) |
| set linearized observation matrix. | |
| vnl_double_3x4 | get_projective_matrix (const vnl_double_3 &v) const |
| compute projective matrix from predicted position. | |
| void | init_covariant_matrix () |
| Initialize the covariance matrix of the state vector to the identity. | |
| void | init_cam_intrinsic () |
| void | init_state_3d_estimation () |
| Define the set of 3-d points that are to be tracked across frames. | |
| void | init_transit_matrix () |
| bool | match_point (vdgl_digital_curve_sptr const &dc, bugl_gaussian_point_2d< double > &p0, double grad_angle, bugl_gaussian_point_2d< double > &p) |
| utility functions. | |
| vcl_vector< bugl_gaussian_point_2d< double > > | get_cur_joe_observes (int frame) |
Private Attributes | |
| bugl_curve_3d | curve_3d_ |
| position and confidence of feature samples. | |
| vcl_vector< double > | prob_ |
| vcl_vector< vcl_vector< bugl_gaussian_point_2d< double > > > | observes_ |
| the set of 2-d points in each frame, used for matching. | |
| vcl_vector< vcl_vector< vcl_vector< bugl_gaussian_point_2d< double > > > > | joe_observes_ |
| the set of 2-d points in each frame grouped by tracked curves. | |
| vcl_vector< vcl_vector< double > > | grad_angles_ |
| the gradient angles corresponding to frame 0 matched tracked curves. | |
| vcl_vector< double > | time_tick_ |
| each element represents image capture time for each frame. | |
| vcl_vector< vcl_vector< vdgl_digital_curve_sptr > > | tracks_ |
| each element of the vector represents a projection of the same 3D curves. | |
| vcl_vector< vnl_double_3 > | motions_ |
| the sequence of translations. | |
| int | cur_pos_ |
| current frame position in history pool. | |
| int | queue_size_ |
| int | num_points_ |
| int | memory_size_ |
| how much the queue has been used. | |
| vnl_vector_fixed< double, 6 > | X_ |
| state vector. | |
| vnl_matrix_fixed< double, 6, 6 > | Q_ |
| covariant matrix of state vector. | |
| vnl_matrix_fixed< double, 6, 2 > | G_ |
| constraint kalman gain matrix. | |
| vnl_matrix_fixed< double, 2, 2 > | R_ |
| initial covariant matrix of state vector. | |
| vnl_matrix_fixed< double, 6, 6 > | Q0_ |
| covariant matrix of 2D projection. | |
| vnl_double_2 * | e_ |
| initial epipole. | |
| vnl_double_3x3 | K_ |
| camera intrinsic parameters. | |
| bool | debug_ |
| debug flag. | |
Static Private Attributes | |
| static const double | large_num_ |
| used to denote outlier point in image. | |
| brct_epi_reconstructor::brct_epi_reconstructor | ( | ) |
| brct_epi_reconstructor::brct_epi_reconstructor | ( | const char * | fname | ) |
Definition at line 49 of file brct_epi_reconstructor.cxx.
| brct_epi_reconstructor::~brct_epi_reconstructor | ( | ) | [virtual] |
Definition at line 86 of file brct_epi_reconstructor.cxx.
| void brct_epi_reconstructor::write_results | ( | const char * | fname | ) |
| vgl_point_2d< double > brct_epi_reconstructor::get_cur_epipole | ( | ) | const |
Definition at line 1182 of file brct_epi_reconstructor.cxx.
| vcl_vector< vnl_matrix< double > > brct_epi_reconstructor::get_back_projection | ( | ) | const |
| vnl_matrix< double > brct_epi_reconstructor::get_predicted_curve | ( | ) |
| vnl_double_3 brct_epi_reconstructor::get_next_motion | ( | vnl_double_3 | v | ) |
Definition at line 1130 of file brct_epi_reconstructor.cxx.
| vcl_vector< vgl_point_2d< double > > brct_epi_reconstructor::get_pre_observes | ( | ) |
Definition at line 1108 of file brct_epi_reconstructor.cxx.
| vcl_vector< vgl_point_2d< double > > brct_epi_reconstructor::get_cur_observes | ( | ) |
Definition at line 1048 of file brct_epi_reconstructor.cxx.
| vcl_vector< vgl_point_2d< double > > brct_epi_reconstructor::get_next_observes | ( | ) |
Definition at line 1027 of file brct_epi_reconstructor.cxx.
| vcl_vector< vgl_point_2d< double > > brct_epi_reconstructor::get_joe_pre_observes | ( | ) |
Definition at line 1082 of file brct_epi_reconstructor.cxx.
| vcl_vector< vgl_point_2d< double > > brct_epi_reconstructor::get_joe_cur_observes | ( | ) |
Definition at line 1069 of file brct_epi_reconstructor.cxx.
| vcl_vector< vgl_point_2d< double > > brct_epi_reconstructor::get_joe_next_observes | ( | ) |
Definition at line 1095 of file brct_epi_reconstructor.cxx.
| vcl_vector< vgl_point_3d< double > > brct_epi_reconstructor::get_local_pts | ( | ) |
Definition at line 998 of file brct_epi_reconstructor.cxx.
| bugl_curve_3d brct_epi_reconstructor::get_curve_3d | ( | ) |
Definition at line 993 of file brct_epi_reconstructor.cxx.
| void brct_epi_reconstructor::read_data | ( | const char * | fname | ) |
read all the data including time stamps and tracks.
Definition at line 812 of file brct_epi_reconstructor.cxx.
| vcl_vector< vdgl_digital_curve_sptr > brct_epi_reconstructor::read_track_file | ( | char * | fname | ) |
read vishual tracker result out of a file.
Each "contour" is the curve in a given image frame. The file format is:
CURVE
[BEGIN CONTOUR]
EDGE_COUNT=150
[202, 298.257] -68.673 13.1904 ([edgel position] angle gradient mag)
...
...
...
[END CONTOUR]
[BEGIN CONTOUR]
EDGE_COUNT=153
[218.086, 295.532] -104.187 50.5706
...
[END CONTOUR]
END CURVE
Definition at line 881 of file brct_epi_reconstructor.cxx.
| void brct_epi_reconstructor::init | ( | ) |
| void brct_epi_reconstructor::init_epipole | ( | double | x, | |
| double | y | |||
| ) |
Definition at line 1204 of file brct_epi_reconstructor.cxx.
| void brct_epi_reconstructor::inc | ( | ) |
Definition at line 690 of file brct_epi_reconstructor.cxx.
| vnl_double_2 brct_epi_reconstructor::projection | ( | const vnl_double_3x4 & | P, | |
| const vnl_double_3 & | X | |||
| ) |
Definition at line 337 of file brct_epi_reconstructor.cxx.
| void brct_epi_reconstructor::add_track | ( | vcl_vector< vdgl_digital_curve_sptr > const & | track | ) |
| void brct_epi_reconstructor::print_track | ( | const int | track_index, | |
| const int | frame | |||
| ) |
| void brct_epi_reconstructor::print_motion_array | ( | ) |
| vcl_vector< double > brct_epi_reconstructor::read_timestamp_file | ( | char * | fname | ) | [protected] |
| double brct_epi_reconstructor::matched_point_prob | ( | vnl_double_2 & | z, | |
| vnl_double_2 & | z_pred | |||
| ) | [protected] |
if the zero probability returned, the matched point is a outlier.
Definition at line 1214 of file brct_epi_reconstructor.cxx.
| vnl_matrix_fixed< double, 6, 6 > brct_epi_reconstructor::get_transit_matrix | ( | int | i, | |
| int | j | |||
| ) | [protected] |
get time interval from ith frame to j-th frame.
Definition at line 1230 of file brct_epi_reconstructor.cxx.
| void brct_epi_reconstructor::update_confidence | ( | ) | [protected] |
| void brct_epi_reconstructor::update_observes | ( | const vnl_double_3x4 & | P, | |
| int | iframe | |||
| ) | [protected] |
update the matched points in the next frame using closest neighbour.
Definition at line 359 of file brct_epi_reconstructor.cxx.
| void brct_epi_reconstructor::update_observes_joe | ( | int | iframe | ) | [protected] |
Definition at line 398 of file brct_epi_reconstructor.cxx.
| void brct_epi_reconstructor::init_velocity | ( | ) | [protected] |
Use the initial epipole to specify the velocity at the first time step.
The initial projection matrix is assumed to be the identity camera. The camera at the first time step is deterimined from the relation,
_ _ _ _ _ _
| w ex | | 1 0 0 0 | | Tx |
| w ey | = [K]| 0 1 0 0 | | Ty |
| w | | 0 0 1 0 | | Tz |
- - - - | 1 |
- -
Definition at line 955 of file brct_epi_reconstructor.cxx.
| vnl_matrix_fixed< double, 2, 6 > brct_epi_reconstructor::get_H_matrix | ( | vnl_double_3x4 & | P, | |
| vnl_double_3 & | Y | |||
| ) | [protected] |
| vnl_double_3x4 brct_epi_reconstructor::get_projective_matrix | ( | const vnl_double_3 & | v | ) | const [protected] |
compute projective matrix from predicted position.
Definition at line 291 of file brct_epi_reconstructor.cxx.
| void brct_epi_reconstructor::init_covariant_matrix | ( | ) | [protected] |
Initialize the covariance matrix of the state vector to the identity.
Initialize covariance matrix of the 2-d projection to have larger variance in the motion direction
Definition at line 236 of file brct_epi_reconstructor.cxx.
| void brct_epi_reconstructor::init_cam_intrinsic | ( | ) | [protected] |
Definition at line 282 of file brct_epi_reconstructor.cxx.
| void brct_epi_reconstructor::init_state_3d_estimation | ( | ) | [protected] |
Define the set of 3-d points that are to be tracked across frames.
Use the observed curves from frame 0 and frame 1 and the initial epipole to define the set of 3-d points that are to be tracked across frames. In this implementation no new 3-d points are created as tracking proceeds, but the initial curve is interpolated to twice its number of samples to define the tracked pointset.
The camera for frame 0 is taken as the identity camera. The camera for frame 1 is defined by the initial epipole. That is, the camera projection of translation vector in 3-d is equivalent to the epipole in frame 1. These two cameras are used to triangulate the 3-d point coordinates are defined in in the coordinate system of camera 0.
Definition at line 105 of file brct_epi_reconstructor.cxx.
| void brct_epi_reconstructor::init_transit_matrix | ( | ) | [protected] |
| bool brct_epi_reconstructor::match_point | ( | vdgl_digital_curve_sptr const & | dc, | |
| bugl_gaussian_point_2d< double > & | p0, | |||
| double | grad_angle, | |||
| bugl_gaussian_point_2d< double > & | p | |||
| ) | [protected] |
| vcl_vector< bugl_gaussian_point_2d< double > > brct_epi_reconstructor::get_cur_joe_observes | ( | int | frame | ) | [protected] |
Definition at line 436 of file brct_epi_reconstructor.cxx.
position and confidence of feature samples.
Definition at line 140 of file brct_epi_reconstructor.h.
vcl_vector<double> brct_epi_reconstructor::prob_ [private] |
Definition at line 142 of file brct_epi_reconstructor.h.
vcl_vector<vcl_vector<bugl_gaussian_point_2d<double> > > brct_epi_reconstructor::observes_ [private] |
the set of 2-d points in each frame, used for matching.
Definition at line 145 of file brct_epi_reconstructor.h.
vcl_vector<vcl_vector<vcl_vector<bugl_gaussian_point_2d<double> > > > brct_epi_reconstructor::joe_observes_ [private] |
the set of 2-d points in each frame grouped by tracked curves.
Definition at line 148 of file brct_epi_reconstructor.h.
vcl_vector<vcl_vector<double> > brct_epi_reconstructor::grad_angles_ [private] |
the gradient angles corresponding to frame 0 matched tracked curves.
Definition at line 151 of file brct_epi_reconstructor.h.
vcl_vector<double> brct_epi_reconstructor::time_tick_ [private] |
each element represents image capture time for each frame.
Definition at line 154 of file brct_epi_reconstructor.h.
vcl_vector<vcl_vector<vdgl_digital_curve_sptr> > brct_epi_reconstructor::tracks_ [private] |
each element of the vector represents a projection of the same 3D curves.
Definition at line 157 of file brct_epi_reconstructor.h.
vcl_vector<vnl_double_3> brct_epi_reconstructor::motions_ [private] |
int brct_epi_reconstructor::cur_pos_ [private] |
int brct_epi_reconstructor::queue_size_ [private] |
Definition at line 164 of file brct_epi_reconstructor.h.
int brct_epi_reconstructor::num_points_ [private] |
Definition at line 165 of file brct_epi_reconstructor.h.
int brct_epi_reconstructor::memory_size_ [private] |
vnl_vector_fixed<double, 6> brct_epi_reconstructor::X_ [private] |
vnl_matrix_fixed<double, 6, 6> brct_epi_reconstructor::Q_ [private] |
vnl_matrix_fixed<double, 6, 2> brct_epi_reconstructor::G_ [private] |
vnl_matrix_fixed<double, 2, 2> brct_epi_reconstructor::R_ [private] |
vnl_matrix_fixed<double, 6, 6> brct_epi_reconstructor::Q0_ [private] |
vnl_double_2* brct_epi_reconstructor::e_ [private] |
vnl_double_3x3 brct_epi_reconstructor::K_ [private] |
const double brct_epi_reconstructor::large_num_ [static, private] |
bool brct_epi_reconstructor::debug_ [private] |
1.5.1