Static Public Member Functions | Private Types | List of all members
vgl_homg_operators_3d< Type > Class Template Reference

3D homogeneous operations. More...

#include <vgl_algo_fwd.h>

Static Public Member Functions

static vnl_vector_fixed< Type, 4 > get_vector (vgl_homg_point_3d< Type > const &p)
 Get a vnl_vector_fixed representation of a homogeneous object. More...
 
static vnl_vector_fixed< Type, 4 > get_vector (vgl_homg_plane_3d< Type > const &p)
 Get a vnl_vector_fixed representation of a homogeneous object. More...
 
static void unitize (vgl_homg_point_3d< Type > &a)
 Normalize vgl_homg_point_3d<Type> to unit magnitude. More...
 
static double angle_between_oriented_lines (const vgl_homg_line_3d &line1, const vgl_homg_line_3d &line2)
 Return the angle between the (oriented) lines (in radians). More...
 
static Type distance (const vgl_homg_point_3d< Type > &point1, const vgl_homg_point_3d< Type > &point2)
 Return the Euclidean distance between the points. More...
 
static Type distance_squared (const vgl_homg_point_3d< Type > &point1, const vgl_homg_point_3d< Type > &point2)
 Return the squared distance between the points. More...
 
static bool is_within_distance (const vgl_homg_point_3d< Type > &p1, const vgl_homg_point_3d< Type > &p2, double d)
 True if the points are closer than Euclidean distance d. More...
 
static double perp_dist_squared (const vgl_homg_point_3d< Type > &point, const vgl_homg_plane_3d< Type > &plane)
 Get the square of the perpendicular distance to a plane. More...
 
static double perp_dist_squared (const vgl_homg_plane_3d< Type > &plane, const vgl_homg_point_3d< Type > &point)
 
static vgl_homg_point_3d< Type > intersect_line_and_plane (const vgl_homg_line_3d &, const vgl_homg_plane_3d< Type > &)
 Return the intersection point of the line and plane. More...
 
static double perp_dist_squared (const vgl_homg_line_3d &line, const vgl_homg_point_3d< Type > &point)
 Return the squared perpendicular distance between the line and point. More...
 
static double perp_dist_squared (const vgl_homg_point_3d< Type > &point, const vgl_homg_line_3d &line)
 
static vgl_homg_line_3d perp_line_through_point (const vgl_homg_line_3d &line, const vgl_homg_point_3d< Type > &point)
 Return the line which is perpendicular to l and passes through p. More...
 
static vgl_homg_point_3d< Type > perp_projection (const vgl_homg_line_3d &line, const vgl_homg_point_3d< Type > &point)
 Compute the perpendicular projection point of p onto l. More...
 
static vgl_homg_line_3d planes_to_line (const vgl_homg_plane_3d< Type > &plane1, const vgl_homg_plane_3d< Type > &plane2)
 Return the intersection line of the planes. More...
 
static Type plane_plane_angle (const vgl_homg_plane_3d< Type > &plane1, const vgl_homg_plane_3d< Type > &plane2)
 Dihedral angle (of intersection) of 2 planes. More...
 
static vgl_homg_point_3d< Type > intersection (const vgl_homg_plane_3d< Type > &, const vgl_homg_plane_3d< Type > &, const vgl_homg_plane_3d< Type > &)
 Compute best-fit intersection of planes in a point. More...
 
static vgl_homg_point_3d< Type > intersection (const std::vector< vgl_homg_plane_3d< Type > > &)
 
static vgl_homg_point_3d< Type > midpoint (const vgl_homg_point_3d< Type > &p1, const vgl_homg_point_3d< Type > &p2)
 Return the midpoint of the line joining two homogeneous points. More...
 
static vgl_homg_point_3d< Type > planes_to_point (const std::vector< vgl_homg_plane_3d< Type > > &planes)
 Intersect a set of 3D planes to find the least-square point of intersection. More...
 
static double cross_ratio (const vgl_homg_point_3d< Type > &p1, const vgl_homg_point_3d< Type > &p2, const vgl_homg_point_3d< Type > &p3, const vgl_homg_point_3d< Type > &p4)
 Calculates the cross ratio of four collinear points p1, p2, p3 and p4. More...
 
static double cross_ratio (const vgl_homg_plane_3d< Type > &p1, const vgl_homg_plane_3d< Type > &p2, const vgl_homg_plane_3d< Type > &p3, const vgl_homg_plane_3d< Type > &p4)
 
static vgl_homg_point_3d< Type > conjugate (const vgl_homg_point_3d< Type > &a, const vgl_homg_point_3d< Type > &b, const vgl_homg_point_3d< Type > &c, double cr=-1.0)
 Conjugate point of three given collinear points. More...
 
static vnl_vector_fixed< Type, 4 > most_orthogonal_vector_svd (const std::vector< vgl_homg_plane_3d< Type > > &planes)
 compute most orthogonal vector with SVD. More...
 

Private Types

typedef vgl_homg_line_3d_2_points< Type > vgl_homg_line_3d
 

Detailed Description

template<class Type>
class vgl_homg_operators_3d< Type >

3D homogeneous operations.

Definition at line 29 of file vgl_algo_fwd.h.

Member Typedef Documentation

◆ vgl_homg_line_3d

template<class Type>
typedef vgl_homg_line_3d_2_points<Type> vgl_homg_operators_3d< Type >::vgl_homg_line_3d
private

Definition at line 30 of file vgl_homg_operators_3d.h.

Member Function Documentation

◆ angle_between_oriented_lines()

template<class Type >
double vgl_homg_operators_3d< Type >::angle_between_oriented_lines ( const vgl_homg_line_3d line1,
const vgl_homg_line_3d line2 
)
static

Return the angle between the (oriented) lines (in radians).

Definition at line 32 of file vgl_homg_operators_3d.hxx.

◆ conjugate()

template<class T>
vgl_homg_point_3d< T > vgl_homg_operators_3d< T >::conjugate ( const vgl_homg_point_3d< T > &  a,
const vgl_homg_point_3d< T > &  b,
const vgl_homg_point_3d< T > &  c,
double  cr = -1.0 
)
static

Conjugate point of three given collinear points.

If cross ratio cr is given (default: -1), the generalized conjugate point returned is such that the cross ratio ((x1,x2;x3,answer)) = cr.

If cross ratio cr is given (default: -1), the generalized conjugate point returned is such that ((x1,x2;x3,answer)) = cr.

Definition at line 457 of file vgl_homg_operators_3d.hxx.

◆ cross_ratio() [1/2]

template<class Type>
double vgl_homg_operators_3d< Type >::cross_ratio ( const vgl_homg_point_3d< Type > &  p1,
const vgl_homg_point_3d< Type > &  p2,
const vgl_homg_point_3d< Type > &  p3,
const vgl_homg_point_3d< Type > &  p4 
)
static

Calculates the cross ratio of four collinear points p1, p2, p3 and p4.

This number is projectively invariant, and it is the coordinate of p4 in the reference frame where p2 is the origin (coordinate 0), p3 is the unity (coordinate 1) and p1 is the point at infinity. This cross ratio is often denoted as ((p1, p2; p3, p4)) (which also equals ((p3, p4; p1, p2)) or ((p2, p1; p4, p3)) or ((p4, p3; p2, p1)) ) and is calculated as

                      p1 - p3   p2 - p3      (p1-p3)(p2-p4)
                      ------- : --------  =  --------------
                      p1 - p4   p2 - p4      (p1-p4)(p2-p3)

In principle, any single nonhomogeneous coordinate from the four points can be used as parameters for cross_ratio (but of course the same for all points). The most reliable answer will be obtained when the coordinate with the largest spacing is used, i.e., the one with smallest slope.

In this implementation, a least-squares result is calculated when the points are not exactly collinear.

Definition at line 405 of file vgl_homg_operators_3d.hxx.

◆ cross_ratio() [2/2]

template<class Type>
double vgl_homg_operators_3d< Type >::cross_ratio ( const vgl_homg_plane_3d< Type > &  p1,
const vgl_homg_plane_3d< Type > &  p2,
const vgl_homg_plane_3d< Type > &  p3,
const vgl_homg_plane_3d< Type > &  p4 
)
static

Definition at line 429 of file vgl_homg_operators_3d.hxx.

◆ distance()

template<class Type>
Type vgl_homg_operators_3d< Type >::distance ( const vgl_homg_point_3d< Type > &  point1,
const vgl_homg_point_3d< Type > &  point2 
)
static

Return the Euclidean distance between the points.

Definition at line 68 of file vgl_homg_operators_3d.hxx.

◆ distance_squared()

template<class Type>
Type vgl_homg_operators_3d< Type >::distance_squared ( const vgl_homg_point_3d< Type > &  point1,
const vgl_homg_point_3d< Type > &  point2 
)
static

Return the squared distance between the points.

Definition at line 45 of file vgl_homg_operators_3d.hxx.

◆ get_vector() [1/2]

template<class Type>
vnl_vector_fixed< Type, 4 > vgl_homg_operators_3d< Type >::get_vector ( vgl_homg_point_3d< Type > const &  p)
static

Get a vnl_vector_fixed representation of a homogeneous object.

Definition at line 350 of file vgl_homg_operators_3d.hxx.

◆ get_vector() [2/2]

template<class Type>
vnl_vector_fixed< Type, 4 > vgl_homg_operators_3d< Type >::get_vector ( vgl_homg_plane_3d< Type > const &  p)
static

Get a vnl_vector_fixed representation of a homogeneous object.

Definition at line 356 of file vgl_homg_operators_3d.hxx.

◆ intersect_line_and_plane()

template<class Type>
vgl_homg_point_3d< Type > vgl_homg_operators_3d< Type >::intersect_line_and_plane ( const vgl_homg_line_3d line,
const vgl_homg_plane_3d< Type > &  plane 
)
static

Return the intersection point of the line and plane.

Definition at line 79 of file vgl_homg_operators_3d.hxx.

◆ intersection() [1/2]

template<class Type>
vgl_homg_point_3d< Type > vgl_homg_operators_3d< Type >::intersection ( const vgl_homg_plane_3d< Type > &  p1,
const vgl_homg_plane_3d< Type > &  p2,
const vgl_homg_plane_3d< Type > &  p3 
)
static

Compute best-fit intersection of planes in a point.

Definition at line 322 of file vgl_homg_operators_3d.hxx.

◆ intersection() [2/2]

template<class Type>
vgl_homg_point_3d< Type > vgl_homg_operators_3d< Type >::intersection ( const std::vector< vgl_homg_plane_3d< Type > > &  planes)
static

Definition at line 331 of file vgl_homg_operators_3d.hxx.

◆ is_within_distance()

template<class Type>
static bool vgl_homg_operators_3d< Type >::is_within_distance ( const vgl_homg_point_3d< Type > &  p1,
const vgl_homg_point_3d< Type > &  p2,
double  d 
)
inlinestatic

True if the points are closer than Euclidean distance d.

Definition at line 52 of file vgl_homg_operators_3d.h.

◆ midpoint()

template<class Type>
vgl_homg_point_3d< Type > vgl_homg_operators_3d< Type >::midpoint ( const vgl_homg_point_3d< Type > &  p1,
const vgl_homg_point_3d< Type > &  p2 
)
static

Return the midpoint of the line joining two homogeneous points.

When one of the points is at infinity, that point is returned. When both points are at infinity, the invalid point (0,0,0,0) is returned.

Definition at line 379 of file vgl_homg_operators_3d.hxx.

◆ most_orthogonal_vector_svd()

template<class T>
vnl_vector_fixed< T, 4 > vgl_homg_operators_3d< T >::most_orthogonal_vector_svd ( const std::vector< vgl_homg_plane_3d< T > > &  planes)
static

compute most orthogonal vector with SVD.

Definition at line 492 of file vgl_homg_operators_3d.hxx.

◆ perp_dist_squared() [1/4]

template<class T>
double vgl_homg_operators_3d< T >::perp_dist_squared ( const vgl_homg_point_3d< T > &  point,
const vgl_homg_plane_3d< T > &  plane 
)
static

Get the square of the perpendicular distance to a plane.

This is just the homogeneous form of the familiar $ \frac{a x + b y + c z + d}{\sqrt{a^2+b^2+c^2}} $ : [ d = \frac{(l^\top p)}{p_z\sqrt{l_x^2 + l_y^2 l_z^2}} ] If either the point or the plane are at infinity an error message is printed and Homg::infinity is returned.

Definition at line 474 of file vgl_homg_operators_3d.hxx.

◆ perp_dist_squared() [2/4]

template<class Type>
static double vgl_homg_operators_3d< Type >::perp_dist_squared ( const vgl_homg_plane_3d< Type > &  plane,
const vgl_homg_point_3d< Type > &  point 
)
inlinestatic

Definition at line 67 of file vgl_homg_operators_3d.h.

◆ perp_dist_squared() [3/4]

template<class Type>
double vgl_homg_operators_3d< Type >::perp_dist_squared ( const vgl_homg_line_3d line,
const vgl_homg_point_3d< Type > &  point 
)
static

Return the squared perpendicular distance between the line and point.

Definition at line 143 of file vgl_homg_operators_3d.hxx.

◆ perp_dist_squared() [4/4]

template<class Type>
static double vgl_homg_operators_3d< Type >::perp_dist_squared ( const vgl_homg_point_3d< Type > &  point,
const vgl_homg_line_3d line 
)
inlinestatic

Definition at line 80 of file vgl_homg_operators_3d.h.

◆ perp_line_through_point()

template<class Type>
vgl_homg_operators_3d< Type >::vgl_homg_line_3d vgl_homg_operators_3d< Type >::perp_line_through_point ( const vgl_homg_line_3d line,
const vgl_homg_point_3d< Type > &  point 
)
static

Return the line which is perpendicular to l and passes through p.

Definition at line 156 of file vgl_homg_operators_3d.hxx.

◆ perp_projection()

template<class Type>
vgl_homg_point_3d< Type > vgl_homg_operators_3d< Type >::perp_projection ( const vgl_homg_line_3d line,
const vgl_homg_point_3d< Type > &  point 
)
static

Compute the perpendicular projection point of p onto l.

Definition at line 190 of file vgl_homg_operators_3d.hxx.

◆ plane_plane_angle()

template<class Type>
Type vgl_homg_operators_3d< Type >::plane_plane_angle ( const vgl_homg_plane_3d< Type > &  plane1,
const vgl_homg_plane_3d< Type > &  plane2 
)
static

Dihedral angle (of intersection) of 2 planes.

Definition at line 210 of file vgl_homg_operators_3d.hxx.

◆ planes_to_line()

template<class Type>
vgl_homg_operators_3d< Type >::vgl_homg_line_3d vgl_homg_operators_3d< Type >::planes_to_line ( const vgl_homg_plane_3d< Type > &  plane1,
const vgl_homg_plane_3d< Type > &  plane2 
)
static

Return the intersection line of the planes.

Definition at line 224 of file vgl_homg_operators_3d.hxx.

◆ planes_to_point()

template<class Type>
vgl_homg_point_3d< Type > vgl_homg_operators_3d< Type >::planes_to_point ( const std::vector< vgl_homg_plane_3d< Type > > &  planes)
static

Intersect a set of 3D planes to find the least-square point of intersection.

This finds the point $\bf x$ that minimizes $\|\tt L \bf x\|$, where $\tt L$ is the matrix whose rows are the planes. The implementation uses vnl_svd to accumulate and compute the nullspace of $\tt L^\top \tt L$.

Definition at line 396 of file vgl_homg_operators_3d.hxx.

◆ unitize()

template<class Type>
void vgl_homg_operators_3d< Type >::unitize ( vgl_homg_point_3d< Type > &  a)
static

Normalize vgl_homg_point_3d<Type> to unit magnitude.

Definition at line 362 of file vgl_homg_operators_3d.hxx.


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