2 #ifndef vgl_h_matrix_3d_h_ 3 #define vgl_h_matrix_3d_h_ 24 #include <vnl/vnl_fwd.h> 25 #include <vnl/vnl_matrix_fixed.h> 30 # include <vcl_msvc_warnings.h> 50 vnl_vector_fixed<T,3>
const& m);
108 void get (vnl_matrix_fixed<T,4,4>* M)
const;
111 void get (vnl_matrix<T>* M)
const;
113 void get (T* M)
const;
115 T
get (
unsigned int row_index,
unsigned int col_index)
const;
121 {
t12_matrix_[row_index][col_index]=value;
return *
this; }
210 void polar_decomposition(vnl_matrix_fixed<T, 3, 3>& S, vnl_matrix_fixed<T, 3, 3>& R)
const;
213 bool read(std::istream& s);
215 bool read(
char const* filename);
222 { H.
read(s);
return s; }
224 #define VGL_H_MATRIX_3D_INSTANTIATE(T) extern "please include vgl/algo/vgl_h_matrix_3d.hxx first" 226 #endif // vgl_h_matrix_3d_h_ vgl_h_matrix_3d & set_rotation_roll_pitch_yaw(T yaw, T pitch, T roll)
Set to roll, pitch and yaw specified rotation.
bool read(std::istream &s)
Load H from ASCII file.
homogeneous plane in 3D projective space
point in projective 3D space
vgl_h_matrix_3d get_inverse() const
Return the inverse homography.
vgl_h_matrix_3d & set_scale(T scale)
compose the current transform with a uniform scaling transformation, S.
vgl_h_matrix_3d & set_translation(T tx, T ty, T tz)
set H[0][3] = tx, H[1][3] = ty, and H[2][3] = tz, other elements unaltered.
vgl_h_matrix_3d(vnl_matrix_fixed< T, 4, 4 > const &M)
Constructor from a 4x4 matrix, and implicit cast from vnl_matrix_fixed<T,4,4>.
vgl_h_matrix_3d & set_affine(vnl_matrix_fixed< T, 3, 4 > const &M34)
set the transform to a general affine transform matrix.
vgl_h_matrix_3d & set(unsigned int row_index, unsigned int col_index, T value)
Set an element of the 4x4 homography matrix.
vgl_h_matrix_3d(vgl_h_matrix_3d< T > const &M)
Copy constructor.
std::ostream & operator<<(std::ostream &s, vgl_orient_box_3d< Type > const &p)
Write box to stream.
vgl_h_matrix_3d & set_rotation_euler(T rz1, T ry, T rz2)
Set to rotation specified by Euler angles.
Represents a homogeneous 3D point.
vgl_h_matrix_3d()=default
vnl_matrix_fixed< T, 3, 3 > get_upper_3x3_matrix() const
vgl_homg_point_3d< T > operator()(vgl_homg_point_3d< T > const &p) const
Return the transformed point given by $q = {\tt H} p$.
bool projective_basis(std::vector< vgl_homg_point_3d< T > > const &five_points)
Compute transform to projective basis given five points, no 4 of which coplanar.
vgl_homg_plane_3d< T > correlation(vgl_homg_point_3d< T > const &p) const
vgl_homg_plane_3d< T > preimage(vgl_homg_plane_3d< T > const &l) const
Return the preimage of a transformed plane: $m = {\tt H} l$.
void get(vnl_matrix_fixed< T, 4, 4 > *M) const
Fill M with contents of the 4x4 homography matrix.
vgl_h_matrix_3d & set_rotation_matrix(vnl_matrix_fixed< T, 3, 3 > const &R)
Just the upper 3x3 part of the matrix is replaced by a rotation matrix.
vnl_vector_fixed< T, 3 > get_translation_vector() const
A class to hold a 3-d projective transformation matrix and to perform common operations using it e....
Represents a Euclidean 3D plane.
vgl_point_3d< T > operator()(vgl_point_3d< T > const &p) const
operate directly on Euclidean points for convenience (no ideal points allowed).
bool operator==(vgl_h_matrix_3d< T > const &M) const
vgl_h_matrix_3d & set_identity()
initialize the transformation to identity.
vgl_homg_point_3d< T > operator *(vgl_homg_point_3d< T > const &p) const
Return the transformed point given by $q = {\tt H} p$.
vnl_matrix_fixed< T, 4, 4 > const & get_matrix() const
Return the 4x4 homography matrix.
std::istream & operator>>(std::istream &is, vgl_orient_box_3d< Type > &p)
Read box from stream.
vgl_homg_point_3d< T > get_translation() const
corresponds to translation for affine transformations.
void polar_decomposition(vnl_matrix_fixed< T, 3, 3 > &S, vnl_matrix_fixed< T, 3, 3 > &R) const
polar decomposition of the upper 3x3 matrix, M = S*R, where S is a symmetric matrix and R is an ortho...
void set_reflection_plane(vgl_plane_3d< double > const &p)
set the transformation to a reflection about a plane.
bool is_euclidean() const
vgl_h_matrix_3d< T > get_upper_3x3() const
corresponds to rotation for Euclidean transformations.
vgl_h_matrix_3d & set_rotation_about_axis(vnl_vector_fixed< T, 3 > const &axis, T theta)
Set to rotation about an axis.
vnl_matrix_fixed< T, 4, 4 > t12_matrix_
~vgl_h_matrix_3d()=default
vgl_h_matrix_3d(T const *M)
Constructor from 4x4 row-storage C-array.