Trains regressor in an mfpf_pose_predictor. More...
#include <mfpf_pose_predictor_builder.h>
Public Member Functions | |
mfpf_pose_predictor_builder () | |
virtual | ~mfpf_pose_predictor_builder () |
void | set_sampling (const mfpf_pose_predictor &) |
Define sampling region and method. | |
void | set_n_per_eg (unsigned n) |
Define number of samples per training image. | |
virtual void | clear (unsigned n_egs) |
Initialise building. | |
virtual void | add_example (const vimt_image_2d_of< float > &image, const mfpf_pose &pose) |
Add one example to the model. | |
virtual void | build (mfpf_pose_predictor &) |
Build object from the data supplied in add_example(). | |
short | version_no () const |
Version number for I/O. | |
virtual vcl_string | is_a () const |
Name of the class. | |
virtual mfpf_pose_predictor_builder * | 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_builder &nc) const |
Test equality. | |
Private Member Functions | |
void | set_defaults () |
Define default values. | |
Private Attributes | |
mfpf_pose_predictor | sampler_ |
Pose predictor object used to do image sampling. | |
vnl_random | rand_ |
Random number generator for offsets. | |
unsigned | n_per_eg_ |
Number of random samples to use per example. | |
vnl_matrix< double > | samples_ |
Samples (one per row). | |
vnl_matrix< double > | poses_ |
Pose vectors for each sample (one per row). | |
unsigned | ci_ |
Current index into samples_/poses_. |
Trains regressor in an mfpf_pose_predictor.
Object set up with a pose predictor which has been partially initialised so as to allow calculation of the image samples. Given a set of training images, this samples at random displacements and trains a linear regressor to predict the given displacement. The internal pose predictor is just used to do the image sampling (to reduce code duplication).
Definition at line 21 of file mfpf_pose_predictor_builder.h.
mfpf_pose_predictor_builder::mfpf_pose_predictor_builder | ( | ) |
Definition at line 19 of file mfpf_pose_predictor_builder.cxx.
mfpf_pose_predictor_builder::~mfpf_pose_predictor_builder | ( | ) | [virtual] |
Definition at line 42 of file mfpf_pose_predictor_builder.cxx.
void mfpf_pose_predictor_builder::add_example | ( | const vimt_image_2d_of< float > & | image, |
const mfpf_pose & | pose | ||
) | [virtual] |
Add one example to the model.
Definition at line 76 of file mfpf_pose_predictor_builder.cxx.
void mfpf_pose_predictor_builder::b_read | ( | vsl_b_istream & | bfs | ) | [virtual] |
Load class from binary file stream.
Definition at line 220 of file mfpf_pose_predictor_builder.cxx.
void mfpf_pose_predictor_builder::b_write | ( | vsl_b_ostream & | bfs | ) | const [virtual] |
Save class to binary file stream.
Definition at line 209 of file mfpf_pose_predictor_builder.cxx.
void mfpf_pose_predictor_builder::build | ( | mfpf_pose_predictor & | p | ) | [virtual] |
Build object from the data supplied in add_example().
Definition at line 140 of file mfpf_pose_predictor_builder.cxx.
void mfpf_pose_predictor_builder::clear | ( | unsigned | n_egs | ) | [virtual] |
Initialise building.
Must be called before any calls to add_example(...)
Definition at line 55 of file mfpf_pose_predictor_builder.cxx.
mfpf_pose_predictor_builder * mfpf_pose_predictor_builder::clone | ( | ) | const [virtual] |
Create a copy on the heap and return base class pointer.
Definition at line 188 of file mfpf_pose_predictor_builder.cxx.
vcl_string mfpf_pose_predictor_builder::is_a | ( | ) | const [virtual] |
Name of the class.
Definition at line 182 of file mfpf_pose_predictor_builder.cxx.
bool mfpf_pose_predictor_builder::operator== | ( | const mfpf_pose_predictor_builder & | nc | ) | const |
Test equality.
Definition at line 240 of file mfpf_pose_predictor_builder.cxx.
void mfpf_pose_predictor_builder::print_shape | ( | vcl_ostream & | os | ) | const |
Prints ASCII representation of shape to os.
void mfpf_pose_predictor_builder::print_summary | ( | vcl_ostream & | os | ) | const [virtual] |
Print class to os.
Definition at line 197 of file mfpf_pose_predictor_builder.cxx.
void mfpf_pose_predictor_builder::set_defaults | ( | ) | [private] |
Define default values.
Definition at line 25 of file mfpf_pose_predictor_builder.cxx.
void mfpf_pose_predictor_builder::set_n_per_eg | ( | unsigned | n | ) |
Define number of samples per training image.
Definition at line 32 of file mfpf_pose_predictor_builder.cxx.
void mfpf_pose_predictor_builder::set_sampling | ( | const mfpf_pose_predictor & | pp | ) |
Define sampling region and method.
Supplied predictor is partially initialised
Definition at line 48 of file mfpf_pose_predictor_builder.cxx.
short mfpf_pose_predictor_builder::version_no | ( | ) | const |
Version number for I/O.
Definition at line 203 of file mfpf_pose_predictor_builder.cxx.
unsigned mfpf_pose_predictor_builder::ci_ [private] |
Current index into samples_/poses_.
Definition at line 40 of file mfpf_pose_predictor_builder.h.
unsigned mfpf_pose_predictor_builder::n_per_eg_ [private] |
Number of random samples to use per example.
Definition at line 31 of file mfpf_pose_predictor_builder.h.
vnl_matrix<double> mfpf_pose_predictor_builder::poses_ [private] |
Pose vectors for each sample (one per row).
Definition at line 37 of file mfpf_pose_predictor_builder.h.
vnl_random mfpf_pose_predictor_builder::rand_ [private] |
Random number generator for offsets.
Definition at line 28 of file mfpf_pose_predictor_builder.h.
Pose predictor object used to do image sampling.
Definition at line 25 of file mfpf_pose_predictor_builder.h.
vnl_matrix<double> mfpf_pose_predictor_builder::samples_ [private] |
Samples (one per row).
Definition at line 34 of file mfpf_pose_predictor_builder.h.