Uses regression to predict new pose from current sample. More...
#include <mfpf_pose_predictor.h>
Public Member Functions | |
mfpf_pose_predictor () | |
virtual | ~mfpf_pose_predictor () |
void | set_step_size (double) |
Size of step between sample points. | |
double | step_size () const |
Size of step between sample points. | |
const mfpf_pose_type & | pose_type () const |
Which sort of transformation to use. | |
void | set_pose_type (const mfpf_pose_type &) |
Which sort of transformation to use. | |
void | set (const vcl_vector< mbl_chord > &roi, double ref_x, double ref_y, short norm_method=1) |
Define region to be used. | |
void | set_as_box (unsigned ni, unsigned nj, short norm_method=1) |
Initialise as a rectangle with ref. in centre. | |
void | set_as_ellipse (double ri, double rj, short norm_method=1) |
Define model region as an ellipse with radii ri, rj. | |
void | set_predictor (const vnl_matrix< double > &R, const vnl_vector< double > &dp0) |
Set regression matrices. | |
void | set_var_min (double var_min) |
Minimum variance used when normalising patch. | |
double | var_min () const |
Minimum variance used when normalising patch. | |
virtual double | radius () const |
Radius of circle containing modelled region. | |
unsigned | n_pixels () const |
virtual void | get_sample_vector (const vimt_image_2d_of< float > &image, const vgl_point_2d< double > &p, const vgl_vector_2d< double > &u, vnl_vector< double > &v) |
Get sample of region around specified point in image. | |
virtual void | new_pose (const vimt_image_2d_of< float > &image, const mfpf_pose &pose0, mfpf_pose &new_pose) |
Sample at pose0 and predict a better pose (new_pose). | |
virtual void | get_outline (vcl_vector< vgl_point_2d< double > > &pts) const |
Generate points in ref frame that represent boundary. | |
short | version_no () const |
Version number for I/O. | |
virtual vcl_string | is_a () const |
Name of the class. | |
virtual mfpf_pose_predictor * | clone () const |
Create a copy on the heap and return base class pointer. | |
virtual void | print_summary (vcl_ostream &os) const |
Print class to os. | |
void | print_shape (vcl_ostream &os) const |
Prints ASCII representation of shape to os. | |
virtual void | b_write (vsl_b_ostream &bfs) const |
Save class to binary file stream. | |
virtual void | b_read (vsl_b_istream &bfs) |
Load class from binary file stream. | |
bool | operator== (const mfpf_pose_predictor &nc) const |
Test equality. | |
Private Member Functions | |
void | set_defaults () |
Define default values. | |
Private Attributes | |
double | step_size_ |
Size of step between sample points. | |
double | ref_x_ |
Kernel reference point (in roi_ni_ x roi_nj_ grid). | |
double | ref_y_ |
Kernel reference point (in roi_ni_ x roi_nj_ grid). | |
vcl_vector< mbl_chord > | roi_ |
Chords defining the region of interest. | |
unsigned | roi_ni_ |
Size of bounding box of region of interest. | |
unsigned | roi_nj_ |
Size of bounding box of region of interest. | |
unsigned | n_pixels_ |
Number of pixels in region. | |
mfpf_pose_type | pose_type_ |
Which sort of transformation to use. | |
short | norm_method_ |
Which normalisation to use (0=none, 1=linear). | |
double | var_min_ |
Lower bound on variance used in normalisation. | |
vnl_matrix< double > | R_ |
Matrix used to predict update dp=Rv+dp0. | |
vnl_vector< double > | dp0_ |
Offset in regression dp=Rv+dp0. |
Uses regression to predict new pose from current sample.
Samples intensities in a region of interest, defined by the set of mbl_chords roi_. These are in the bounding box [0,roi_ni_)x[0,roi_nj_). Uses a pre-trained regression function to predict a better position based on this sample.
Definition at line 29 of file mfpf_pose_predictor.h.
mfpf_pose_predictor::mfpf_pose_predictor | ( | ) |
Definition at line 25 of file mfpf_pose_predictor.cxx.
mfpf_pose_predictor::~mfpf_pose_predictor | ( | ) | [virtual] |
Definition at line 89 of file mfpf_pose_predictor.cxx.
void mfpf_pose_predictor::b_read | ( | vsl_b_istream & | bfs | ) | [virtual] |
Load class from binary file stream.
Definition at line 318 of file mfpf_pose_predictor.cxx.
void mfpf_pose_predictor::b_write | ( | vsl_b_ostream & | bfs | ) | const [virtual] |
Save class to binary file stream.
Definition at line 298 of file mfpf_pose_predictor.cxx.
mfpf_pose_predictor * mfpf_pose_predictor::clone | ( | ) | const [virtual] |
Create a copy on the heap and return base class pointer.
Definition at line 252 of file mfpf_pose_predictor.cxx.
void mfpf_pose_predictor::get_outline | ( | vcl_vector< vgl_point_2d< double > > & | pts | ) | const [virtual] |
Generate points in ref frame that represent boundary.
Points of a contour around the shape. Used for display purposes.
Definition at line 228 of file mfpf_pose_predictor.cxx.
void mfpf_pose_predictor::get_sample_vector | ( | const vimt_image_2d_of< float > & | image, |
const vgl_point_2d< double > & | p, | ||
const vgl_vector_2d< double > & | u, | ||
vnl_vector< double > & | v | ||
) | [virtual] |
Get sample of region around specified point in image.
Definition at line 155 of file mfpf_pose_predictor.cxx.
vcl_string mfpf_pose_predictor::is_a | ( | ) | const [virtual] |
Name of the class.
Definition at line 246 of file mfpf_pose_predictor.cxx.
unsigned mfpf_pose_predictor::n_pixels | ( | ) | const [inline] |
Definition at line 116 of file mfpf_pose_predictor.h.
void mfpf_pose_predictor::new_pose | ( | const vimt_image_2d_of< float > & | image, |
const mfpf_pose & | pose0, | ||
mfpf_pose & | new_pose | ||
) | [virtual] |
Sample at pose0 and predict a better pose (new_pose).
Definition at line 188 of file mfpf_pose_predictor.cxx.
bool mfpf_pose_predictor::operator== | ( | const mfpf_pose_predictor & | nc | ) | const |
Test equality.
Definition at line 348 of file mfpf_pose_predictor.cxx.
const mfpf_pose_type& mfpf_pose_predictor::pose_type | ( | ) | const [inline] |
Which sort of transformation to use.
Definition at line 84 of file mfpf_pose_predictor.h.
void mfpf_pose_predictor::print_shape | ( | vcl_ostream & | os | ) | const |
Prints ASCII representation of shape to os.
Definition at line 276 of file mfpf_pose_predictor.cxx.
void mfpf_pose_predictor::print_summary | ( | vcl_ostream & | os | ) | const [virtual] |
Print class to os.
Definition at line 261 of file mfpf_pose_predictor.cxx.
double mfpf_pose_predictor::radius | ( | ) | const [virtual] |
Radius of circle containing modelled region.
Definition at line 141 of file mfpf_pose_predictor.cxx.
void mfpf_pose_predictor::set | ( | const vcl_vector< mbl_chord > & | roi, |
double | ref_x, | ||
double | ref_y, | ||
short | norm_method = 1 |
||
) |
Define region to be used.
Define region and cost of region.
Definition at line 94 of file mfpf_pose_predictor.cxx.
void mfpf_pose_predictor::set_as_box | ( | unsigned | ni, |
unsigned | nj, | ||
short | norm_method = 1 |
||
) |
Initialise as a rectangle with ref. in centre.
Definition at line 52 of file mfpf_pose_predictor.cxx.
void mfpf_pose_predictor::set_as_ellipse | ( | double | ri, |
double | rj, | ||
short | norm_method = 1 |
||
) |
Define model region as an ellipse with radii ri, rj.
Ref. point in centre.
Definition at line 64 of file mfpf_pose_predictor.cxx.
void mfpf_pose_predictor::set_defaults | ( | ) | [private] |
Define default values.
Definition at line 31 of file mfpf_pose_predictor.cxx.
void mfpf_pose_predictor::set_pose_type | ( | const mfpf_pose_type & | pt | ) |
Which sort of transformation to use.
Definition at line 81 of file mfpf_pose_predictor.cxx.
void mfpf_pose_predictor::set_predictor | ( | const vnl_matrix< double > & | R, |
const vnl_vector< double > & | dp0 | ||
) |
Set regression matrices.
Definition at line 132 of file mfpf_pose_predictor.cxx.
void mfpf_pose_predictor::set_step_size | ( | double | s | ) |
Size of step between sample points.
Definition at line 46 of file mfpf_pose_predictor.cxx.
void mfpf_pose_predictor::set_var_min | ( | double | var_min | ) | [inline] |
Minimum variance used when normalising patch.
Definition at line 108 of file mfpf_pose_predictor.h.
double mfpf_pose_predictor::step_size | ( | ) | const [inline] |
Size of step between sample points.
Definition at line 81 of file mfpf_pose_predictor.h.
double mfpf_pose_predictor::var_min | ( | ) | const [inline] |
Minimum variance used when normalising patch.
Definition at line 111 of file mfpf_pose_predictor.h.
short mfpf_pose_predictor::version_no | ( | ) | const |
Version number for I/O.
Definition at line 292 of file mfpf_pose_predictor.cxx.
vnl_vector<double> mfpf_pose_predictor::dp0_ [private] |
Offset in regression dp=Rv+dp0.
Definition at line 64 of file mfpf_pose_predictor.h.
unsigned mfpf_pose_predictor::n_pixels_ [private] |
Number of pixels in region.
Definition at line 49 of file mfpf_pose_predictor.h.
short mfpf_pose_predictor::norm_method_ [private] |
Which normalisation to use (0=none, 1=linear).
Definition at line 55 of file mfpf_pose_predictor.h.
Which sort of transformation to use.
Definition at line 52 of file mfpf_pose_predictor.h.
vnl_matrix<double> mfpf_pose_predictor::R_ [private] |
Matrix used to predict update dp=Rv+dp0.
Definition at line 61 of file mfpf_pose_predictor.h.
double mfpf_pose_predictor::ref_x_ [private] |
Kernel reference point (in roi_ni_ x roi_nj_ grid).
Definition at line 36 of file mfpf_pose_predictor.h.
double mfpf_pose_predictor::ref_y_ [private] |
Kernel reference point (in roi_ni_ x roi_nj_ grid).
Definition at line 38 of file mfpf_pose_predictor.h.
vcl_vector<mbl_chord> mfpf_pose_predictor::roi_ [private] |
Chords defining the region of interest.
Definition at line 41 of file mfpf_pose_predictor.h.
unsigned mfpf_pose_predictor::roi_ni_ [private] |
Size of bounding box of region of interest.
Definition at line 44 of file mfpf_pose_predictor.h.
unsigned mfpf_pose_predictor::roi_nj_ [private] |
Size of bounding box of region of interest.
Definition at line 46 of file mfpf_pose_predictor.h.
double mfpf_pose_predictor::step_size_ [private] |
Size of step between sample points.
Definition at line 33 of file mfpf_pose_predictor.h.
double mfpf_pose_predictor::var_min_ [private] |
Lower bound on variance used in normalisation.
Definition at line 58 of file mfpf_pose_predictor.h.