#include <vimt_transform_2d.h>
In order of complexity the transform can be
Identity x->x, y->y Translation x->x + tx, y->y + ty ZoomOnly x->sx.x + tx, y->sy.y + ty RigidBody (Translate + rotation) Euclidean (Translation + rotation + scale) Affine Projective
NOTES: The transformation can be represented by a 3x3 matrix mapping homogeneous co-ordinates about.
( xx xy xt ) ( yx yy yt ) ( tx ty tt )
Example:
vimt_transform_2d T1; vimt_transform_2d T2; T1.set_zoom(scale,translation.x(),translation.y()); T2.set_similarity(scale2,theta,translation2.x(),translation2.y()); vimt_transform_2d T3 = T2 * T1; // T1 followed by T2 vgl_point_2d<double> p(10,10); vgl_point_2d<double> p_new = T3(p); vimt_transform_2d T_inverse = T3.inverse();
Definition at line 54 of file vimt_transform_2d.h.
Public Types | |
| enum | Form { Identity, Translation, ZoomOnly, RigidBody, Similarity, Affine, Projective, Reflection } |
| Defines form of transformation. More... | |
Public Member Functions | |
| vimt_transform_2d () | |
| bool | is_identity () const |
| Form | form () const |
| vnl_matrix< double > | matrix () const |
| void | matrix (vnl_matrix< double > &) const |
| void | params (vnl_vector< double > &v) const |
| Fills v with parameters. | |
| void | set (const vnl_vector< double > &v, Form) |
| Sets transform using v (converse of params(v)). | |
| void | set_identity () |
| Set to identity transformation. | |
| void | set_zoom_only (double s_x, double s_y, double t_x, double t_y) |
| Sets the transformation to be separable affine. | |
| void | set_zoom_only (double s, double t_x, double t_y) |
| Sets the transformation to be a zoom. | |
| void | set_translation (double t_x, double t_y) |
| Sets the transformation to be a translation. | |
| void | set_rigid_body (double theta, double t_x, double t_y) |
| Sets the transformation to rotation then translation. | |
| void | set_similarity (double s, double theta, double t_x, double t_y) |
| Sets the transformation to apply scaling, rotation then translation. | |
| void | set_similarity (const vgl_point_2d< double > &dx, const vgl_point_2d< double > &t) |
| Sets Euclidean transformation. | |
| void | set_reflection (const vgl_point_2d< double > &m1, const vgl_point_2d< double > &m2) |
| reflect about a line though the points m1, and m2. | |
| void | set_affine (const vnl_matrix< double > &) |
| Sets to be 2D affine transformation using 2x3 matrix. | |
| void | set_affine (const vgl_point_2d< double > &p, const vgl_vector_2d< double > &u, const vgl_vector_2d< double > &v) |
| Sets to be 2D affine transformation T(x,y)=p+x.u+y.v. | |
| void | set_projective (const vnl_matrix< double > &) |
| Sets to be 2D projective transformation. | |
| vgl_point_2d< double > | origin () const |
| Returns the coordinates of the origin. | |
| void | set_origin (const vgl_point_2d< double > &) |
| Modifies the transformation so that operator()(vgl_point_2d<double> (0,0)) == p. | |
| vgl_point_2d< double > | operator() (double x, double y) const |
| Applies transformation to (x,y). | |
| vgl_point_2d< double > | operator() (const vgl_point_2d< double > &p) const |
| Returns transformation applied to point p. | |
| vimt_transform_2d | inverse () const |
| Calculates inverse of this transformation. | |
| vgl_vector_2d< double > | delta (const vgl_point_2d< double > &p, const vgl_vector_2d< double > &dp) const |
| Returns change in transformed point when original point moved by dp. | |
| short | version_no () const |
| void | print_summary (vcl_ostream &) const |
| void | b_write (vsl_b_ostream &bfs) const |
| void | b_read (vsl_b_istream &bfs) |
| bool | operator== (const vimt_transform_2d &t) const |
| True if t is the same as this. | |
Private Member Functions | |
| void | calcInverse () const |
| void | setCheck (int n1, int n2, const char *str) const |
Private Attributes | |
| double | xx_ |
| double | xy_ |
| double | xt_ |
| double | yx_ |
| double | yy_ |
| double | yt_ |
| double | tx_ |
| double | ty_ |
| double | tt_ |
| Form | form_ |
| double | xx2_ |
| double | xy2_ |
| double | xt2_ |
| double | yx2_ |
| double | yy2_ |
| double | yt2_ |
| double | tx2_ |
| double | ty2_ |
| double | tt2_ |
| bool | inv_uptodate_ |
Friends | |
| vimt_transform_2d | operator * (const vimt_transform_2d &, const vimt_transform_2d &) |
|
|
Defines form of transformation.
Definition at line 58 of file vimt_transform_2d.h. |
|
|
Definition at line 67 of file vimt_transform_2d.h. |
|
|
Definition at line 704 of file vimt_transform_2d.cxx. |
|
|
Definition at line 695 of file vimt_transform_2d.cxx. |
|
|
Definition at line 418 of file vimt_transform_2d.cxx. |
|
||||||||||||
|
Returns change in transformed point when original point moved by dp. Point dp: Movement from point Returns: T(p+dp)-T(p) Definition at line 373 of file vimt_transform_2d.cxx. |
|
|
Definition at line 75 of file vimt_transform_2d.h. |
|
|
Calculates inverse of this transformation.
Definition at line 398 of file vimt_transform_2d.cxx. |
|
|
Definition at line 74 of file vimt_transform_2d.h. |
|
|
Definition at line 24 of file vimt_transform_2d.cxx. |
|
|
Definition at line 17 of file vimt_transform_2d.cxx. |
|
|
Returns transformation applied to point p.
Definition at line 146 of file vimt_transform_2d.h. |
|
||||||||||||
|
Applies transformation to (x,y).
Definition at line 345 of file vimt_transform_2d.cxx. |
|
|
True if t is the same as this.
Definition at line 478 of file vimt_transform_2d.cxx. |
|
|
Returns the coordinates of the origin. I.e. operator()(vgl_point_2d<double> (0,0)) Definition at line 135 of file vimt_transform_2d.h. |
|
|
Fills v with parameters.
Definition at line 33 of file vimt_transform_2d.cxx. |
|
|
Definition at line 626 of file vimt_transform_2d.cxx. |
|
||||||||||||
|
Sets transform using v (converse of params(v)).
Definition at line 94 of file vimt_transform_2d.cxx. |
|
||||||||||||||||
|
Sets to be 2D affine transformation T(x,y)=p+x.u+y.v.
Definition at line 313 of file vimt_transform_2d.cxx. |
|
|
Sets to be 2D affine transformation using 2x3 matrix.
Definition at line 286 of file vimt_transform_2d.cxx. |
|
|
Set to identity transformation.
Definition at line 154 of file vimt_transform_2d.cxx. |
|
|
Modifies the transformation so that operator()(vgl_point_2d<double> (0,0)) == p. The rest of the transformation is unaffected. If the transformation was previously the identity, it becomes a translation. Definition at line 184 of file vimt_transform_2d.cxx. |
|
|
Sets to be 2D projective transformation.
Definition at line 327 of file vimt_transform_2d.cxx. |
|
||||||||||||
|
reflect about a line though the points m1, and m2.
Definition at line 206 of file vimt_transform_2d.cxx. |
|
||||||||||||||||
|
Sets the transformation to rotation then translation. theta: rotation t_x: Translation in x t_y: Translation in y Definition at line 238 of file vimt_transform_2d.cxx. |
|
||||||||||||
|
Sets Euclidean transformation.
Definition at line 275 of file vimt_transform_2d.cxx. |
|
||||||||||||||||||||
|
Sets the transformation to apply scaling, rotation then translation. s: Scaling theta: rotation t_x: Translation in x t_y: Translation in y Definition at line 256 of file vimt_transform_2d.cxx. |
|
||||||||||||
|
Sets the transformation to be a translation. t_x: Translation in x t_y: Translation in y Definition at line 166 of file vimt_transform_2d.cxx. |
|
||||||||||||||||
|
Sets the transformation to be a zoom. x' = s.x + t_x, y' = s.y + t_y s: Scaling t_x: Translation in x t_y: Translation in y Definition at line 97 of file vimt_transform_2d.h. |
|
||||||||||||||||||||
|
Sets the transformation to be separable affine. x' = s_x.x + t_x, y' = s_y.y + t_y s_x: Scaling in x s_y: Scaling in y t_x: Translation in x t_y: Translation in y Definition at line 194 of file vimt_transform_2d.cxx. |
|
||||||||||||||||
|
Definition at line 86 of file vimt_transform_2d.cxx. |
|
|
Definition at line 692 of file vimt_transform_2d.cxx. |
|
||||||||||||
|
Definition at line 492 of file vimt_transform_2d.cxx. |
|
|
Definition at line 169 of file vimt_transform_2d.h. |
|
|
Definition at line 173 of file vimt_transform_2d.h. |
|
|
Definition at line 172 of file vimt_transform_2d.h. |
|
|
Definition at line 168 of file vimt_transform_2d.h. |
|
|
Definition at line 172 of file vimt_transform_2d.h. |
|
|
Definition at line 168 of file vimt_transform_2d.h. |
|
|
Definition at line 172 of file vimt_transform_2d.h. |
|
|
Definition at line 168 of file vimt_transform_2d.h. |
|
|
Definition at line 172 of file vimt_transform_2d.h. |
|
|
Definition at line 168 of file vimt_transform_2d.h. |
|
|
Definition at line 172 of file vimt_transform_2d.h. |
|
|
Definition at line 168 of file vimt_transform_2d.h. |
|
|
Definition at line 172 of file vimt_transform_2d.h. |
|
|
Definition at line 168 of file vimt_transform_2d.h. |
|
|
Definition at line 172 of file vimt_transform_2d.h. |
|
|
Definition at line 168 of file vimt_transform_2d.h. |
|
|
Definition at line 172 of file vimt_transform_2d.h. |
|
|
Definition at line 168 of file vimt_transform_2d.h. |
|
|
Definition at line 172 of file vimt_transform_2d.h. |
|
|
Definition at line 168 of file vimt_transform_2d.h. |
1.4.4