PCL
pcl::Homography Class Reference

Homography geometric transformation. More...

#include <Homography.h>

Public Member Functions

 Homography ()
 
 Homography (const Homography &)=default
 
 Homography (const Matrix &H)
 
template<class point_list1 , class point_list2 >
 Homography (const point_list1 &P1, const point_list2 &P2)
 
 Homography (Homography &&)=default
 
template<typename T >
GenericPoint< T > & Apply (GenericPoint< T > &p) const
 
template<typename T1 , typename T2 >
void Apply (T1 &x, T2 &y) const
 
void EnsureUnique ()
 
Homography Inverse () const
 
bool IsAffine () const
 
bool IsValid () const
 
 operator const Matrix & () const
 
template<typename T >
DPoint operator() (const GenericPoint< T > &p) const
 
DPoint operator() (double x, double y) const
 
Homographyoperator= (const Homography &)=default
 
Homographyoperator= (Homography &&)=default
 
const MatrixTransformationMatrix () const
 

Detailed Description

A two-dimensional projective transformation, or homography, is a line-preserving geometric transformation between two sets of points in the plane. More formally, if P represents the set of points in the plane, a homography is an invertible map H of P^2 to itself such that three points p1, p2, p3 are collinear if and only if H(p1), H(p2), H(p3) are collinear.

Homographies have important practical applications in the field of computer vision. On the PixInsight platform, this class is an essential component of image registration and astrometry processes.

Definition at line 84 of file Homography.h.

Constructor & Destructor Documentation

◆ Homography() [1/5]

pcl::Homography::Homography ( )
inline

Default constructor. Constructs a no-op transformation with a unit transformation matrix.

Definition at line 92 of file Homography.h.

◆ Homography() [2/5]

pcl::Homography::Homography ( const Matrix H)
inline

Constructor from a given homography matrix.

Definition at line 100 of file Homography.h.

◆ Homography() [3/5]

template<class point_list1 , class point_list2 >
pcl::Homography::Homography ( const point_list1 &  P1,
const point_list2 &  P2 
)
inline

Constructor from two 2D point lists.

Computes a homography to generate a list P2 of transformed points from a list P1 of original points. In other words, the computed homography H works as follows:

P2 = H( P1 )

The transformation matrix is calculated by the Direct Linear Transformation (DLT) method. Both point lists must contain at least four points.

If one of the specified point lists contains less than four points, or if no homography can be estimated from the specified point lists (which leads to a singular transformation matrix), this constructor throws an appropriate Error exception.

References

R. Hartley, In defense of the eight-point algorithm. IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 19, pp. 580–593, June 1997.

Definition at line 130 of file Homography.h.

◆ Homography() [4/5]

pcl::Homography::Homography ( const Homography )
default

Copy constructor.

◆ Homography() [5/5]

pcl::Homography::Homography ( Homography &&  )
default

Move constructor.

Member Function Documentation

◆ Apply() [1/2]

template<typename T >
GenericPoint<T>& pcl::Homography::Apply ( GenericPoint< T > &  p) const
inline

Coordinate transformation. Applies the homography to the specified point p. Returns a reference to p;

The type T must be constructible from and convertible to double.

Definition at line 180 of file Homography.h.

References pcl::Apply(), pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.

◆ Apply() [2/2]

template<typename T1 , typename T2 >
void pcl::Homography::Apply ( T1 &  x,
T2 &  y 
) const
inline

Coordinate transformation. Applies the homography to the specified x and y coordinates.

The types T1 and T2 must be constructible from and convertible to double.

Definition at line 163 of file Homography.h.

◆ EnsureUnique()

void pcl::Homography::EnsureUnique ( )
inline

Ensures that this object uniquely references its internal matrix data.

Definition at line 270 of file Homography.h.

◆ Inverse()

Homography pcl::Homography::Inverse ( ) const
inline

Returns the inverse of this homography.

If this transformation has been computed from two point lists P1 and P2:

P2 = H( P1 )

then this function returns a transformation H1 such that:

P1 = H1( P2 )

Definition at line 221 of file Homography.h.

◆ IsAffine()

bool pcl::Homography::IsAffine ( ) const
inline

Returns true iff this is an affine homography transformation.

An affine homography is a special type of a general homography where the last row of the 3x3 transformation matrix is equal to (0, 0, 1). This function verifies that this property holds for the current transformation matrix (if it is valid) up to the machine epsilon for the double numeric type.

Definition at line 259 of file Homography.h.

References pcl::Abs().

◆ IsValid()

bool pcl::Homography::IsValid ( ) const
inline

Returns true iff this transformation has been initialized and is valid.

Definition at line 245 of file Homography.h.

◆ operator const Matrix &()

pcl::Homography::operator const Matrix & ( ) const
inline

Returns the homography transformation matrix.

Definition at line 237 of file Homography.h.

◆ operator()() [1/2]

template<typename T >
DPoint pcl::Homography::operator() ( const GenericPoint< T > &  p) const
inline

Point transformation operator. Applies the homography to the coordinates of the specified point p. Returns the transformed point as a two-dimensional point with real coordinates.

Definition at line 204 of file Homography.h.

References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.

◆ operator()() [2/2]

DPoint pcl::Homography::operator() ( double  x,
double  y 
) const
inline

Coordinate transformation operator. Applies the homography to the specified x and y coordinates. Returns the transformed point as a two-dimensional point with real coordinates.

Definition at line 191 of file Homography.h.

References pcl::Apply(), pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.

◆ operator=() [1/2]

Homography& pcl::Homography::operator= ( const Homography )
default

Copy assignment operator.

◆ operator=() [2/2]

Homography& pcl::Homography::operator= ( Homography &&  )
default

Move assignment operator.

◆ TransformationMatrix()

const Matrix& pcl::Homography::TransformationMatrix ( ) const
inline

Returns the homography transformation matrix.

Definition at line 229 of file Homography.h.


The documentation for this class was generated from the following file: