#include <mbl_thin_plate_spline_2d.h>
I.e. does some mapping (x',y') = f(x,y). (See Booksteins work, e.g. IPMI 1993) The warp is `guided' by a set of landmarks p(0) .. p(n-1) in the source plane which are to be mapped to a (possibly deformed) set q(0)..q(n-1) in the destination. Thus the mapping is constrained so that f(p(i)) = q(i) for i = 0..n-1. The points are given to the build() function to set up the object.
If one wishes to map a set of source points to multiple target points, use set_source_pts(src_pts); then build(target_pts); for each target set.
vcl_vector<vgl_point_2d<double> > src_pts(n_points),dest_pts(n_points); Fill src_pts and dest_pts ..... Construct spline object mbl_thin_plate_spline_2d tps; tps.build(src_pts,dest_pts); // Apply to point p: vgl_point_3d<double> p(1,2); vgl_point_2d<double> new_p = tps(p);
Definition at line 42 of file mbl_thin_plate_spline_2d.h.
Public Member Functions | |
| mbl_thin_plate_spline_2d () | |
| Dflt ctor. | |
| virtual | ~mbl_thin_plate_spline_2d () |
| Destructor. | |
| void | build (const vcl_vector< vgl_point_2d< double > > &source_pts, const vcl_vector< vgl_point_2d< double > > &dest_pts, bool compute_the_energy=false) |
| Sets up internal transformation to map source_pts onto dest_pts. | |
| void | set_source_pts (const vcl_vector< vgl_point_2d< double > > &source_pts) |
| Define source point positions. | |
| void | build (const vcl_vector< vgl_point_2d< double > > &dest_pts) |
| Sets up internal transformation to map source_pts onto dest_pts. | |
| vgl_point_2d< double > | operator() (double x, double y) const |
| Return transformed version of (x,y). | |
| vgl_point_2d< double > | operator() (const vgl_point_2d< double > &p) const |
| Return transformed version of (x,y). | |
| double | bendingEnergyX () const |
| Bending energy of X component (zero for pure affine). | |
| double | bendingEnergyY () const |
| Bending energy of X component (zero for pure affine). | |
| void | set_pure_affine (bool val) |
| If this parameter is set to true, then only global affine part of the currently computed transformation is used. | |
| short | version_no () const |
| Version number for I/O. | |
| void | print_summary (vcl_ostream &os) const |
| Print class to os. | |
| void | b_write (vsl_b_ostream &bfs) const |
| Save class to binary file stream. | |
| void | b_read (vsl_b_istream &bfs) |
| Load class from binary file stream. | |
| bool | operator== (const mbl_thin_plate_spline_2d &tps) const |
| Comparison operator. | |
Private Member Functions | |
| void | build_pure_affine (const vcl_vector< vgl_point_2d< double > > &source_pts, const vcl_vector< vgl_point_2d< double > > &dest_pts) |
| Build from small number of points. | |
| void | set_params (const vnl_vector< double > &W1, const vnl_vector< double > &W2) |
| Set parameters from vectors. | |
| void | set_up_rhs (vnl_vector< double > &Bx, vnl_vector< double > &By, const vcl_vector< vgl_point_2d< double > > &dest_pts) |
| void | compute_energy (vnl_vector< double > &W1, vnl_vector< double > &W2, const vnl_matrix< double > &L) |
| Compute spline-bending energy. | |
Private Attributes | |
| vnl_vector< double > | Wx_ |
| vnl_vector< double > | Wy_ |
| double | Ax0_ |
| double | AxX_ |
| double | AxY_ |
| double | Ay0_ |
| double | AyX_ |
| double | AyY_ |
| double | energy_x_ |
| double | energy_y_ |
| bool | return_pure_affine_ |
| vcl_vector< vgl_point_2d< double > > | src_pts_ |
| vnl_matrix< double > | L_inv_ |
| Used to estimate weights in set_source_points(). | |
|
|
Dflt ctor.
Definition at line 26 of file mbl_thin_plate_spline_2d.cxx. |
|
|
Destructor.
Definition at line 37 of file mbl_thin_plate_spline_2d.cxx. |
|
|
Load class from binary file stream.
Definition at line 511 of file mbl_thin_plate_spline_2d.cxx. |
|
|
Save class to binary file stream.
Definition at line 495 of file mbl_thin_plate_spline_2d.cxx. |
|
|
Bending energy of X component (zero for pure affine). A measure of total amount of non-linear deformation Definition at line 103 of file mbl_thin_plate_spline_2d.h. |
|
|
Bending energy of X component (zero for pure affine). A measure of total amount of non-linear deformation Definition at line 107 of file mbl_thin_plate_spline_2d.h. |
|
|
Sets up internal transformation to map source_pts onto dest_pts.
Definition at line 411 of file mbl_thin_plate_spline_2d.cxx. |
|
||||||||||||||||
|
Sets up internal transformation to map source_pts onto dest_pts.
Definition at line 339 of file mbl_thin_plate_spline_2d.cxx. |
|
||||||||||||
|
Build from small number of points.
Definition at line 126 of file mbl_thin_plate_spline_2d.cxx. |
|
||||||||||||||||
|
Compute spline-bending energy.
Definition at line 289 of file mbl_thin_plate_spline_2d.cxx. |
|
|
Return transformed version of (x,y).
Definition at line 98 of file mbl_thin_plate_spline_2d.h. |
|
||||||||||||
|
Return transformed version of (x,y).
Definition at line 440 of file mbl_thin_plate_spline_2d.cxx. |
|
|
Comparison operator.
Definition at line 537 of file mbl_thin_plate_spline_2d.cxx. |
|
|
Print class to os.
Definition at line 479 of file mbl_thin_plate_spline_2d.cxx. |
|
||||||||||||
|
Set parameters from vectors.
Definition at line 261 of file mbl_thin_plate_spline_2d.cxx. |
|
|
If this parameter is set to true, then only global affine part of the currently computed transformation is used.
Definition at line 112 of file mbl_thin_plate_spline_2d.h. |
|
|
Define source point positions. Performs pre-computations so that build(dest_points) can be called multiple times efficiently Definition at line 387 of file mbl_thin_plate_spline_2d.cxx. |
|
||||||||||||||||
|
Definition at line 315 of file mbl_thin_plate_spline_2d.cxx. |
|
|
Version number for I/O.
Definition at line 468 of file mbl_thin_plate_spline_2d.cxx. |
|
|
Definition at line 45 of file mbl_thin_plate_spline_2d.h. |
|
|
Definition at line 45 of file mbl_thin_plate_spline_2d.h. |
|
|
Definition at line 45 of file mbl_thin_plate_spline_2d.h. |
|
|
Definition at line 46 of file mbl_thin_plate_spline_2d.h. |
|
|
Definition at line 46 of file mbl_thin_plate_spline_2d.h. |
|
|
Definition at line 46 of file mbl_thin_plate_spline_2d.h. |
|
|
Definition at line 47 of file mbl_thin_plate_spline_2d.h. |
|
|
Definition at line 47 of file mbl_thin_plate_spline_2d.h. |
|
|
Used to estimate weights in set_source_points().
Definition at line 54 of file mbl_thin_plate_spline_2d.h. |
|
|
Definition at line 49 of file mbl_thin_plate_spline_2d.h. |
|
|
Definition at line 51 of file mbl_thin_plate_spline_2d.h. |
|
|
Definition at line 44 of file mbl_thin_plate_spline_2d.h. |
|
|
Definition at line 44 of file mbl_thin_plate_spline_2d.h. |
1.4.4