3D homogeneous operations. More...
#include <vgl_homg_operators_3d.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. | |
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. | |
static void | unitize (vgl_homg_point_3d< Type > &a) |
Normalize vgl_homg_point_3d<Type> to unit magnitude. | |
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). | |
static Type | distance (const vgl_homg_point_3d< Type > &point1, const vgl_homg_point_3d< Type > &point2) |
Return the Euclidean distance between the points. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
static vgl_homg_point_3d< Type > | intersection (const vcl_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. | |
static vgl_homg_point_3d< Type > | planes_to_point (const vcl_vector< vgl_homg_plane_3d< Type > > &planes) |
Intersect a set of 3D planes to find the least-square point of intersection. | |
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. | |
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. | |
static vnl_vector_fixed< Type, 4 > | most_orthogonal_vector_svd (const vcl_vector< vgl_homg_plane_3d< Type > > &planes) |
compute most orthogonal vector with SVD. | |
Private Types | |
typedef vgl_homg_line_3d_2_points < Type > | vgl_homg_line_3d |
3D homogeneous operations.
Definition at line 28 of file vgl_homg_operators_3d.h.
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.
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 29 of file vgl_homg_operators_3d.txx.
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 454 of file vgl_homg_operators_3d.txx.
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 402 of file vgl_homg_operators_3d.txx.
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 426 of file vgl_homg_operators_3d.txx.
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 65 of file vgl_homg_operators_3d.txx.
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 42 of file vgl_homg_operators_3d.txx.
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 347 of file vgl_homg_operators_3d.txx.
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 353 of file vgl_homg_operators_3d.txx.
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 76 of file vgl_homg_operators_3d.txx.
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 319 of file vgl_homg_operators_3d.txx.
vgl_homg_point_3d< Type > vgl_homg_operators_3d< Type >::intersection | ( | const vcl_vector< vgl_homg_plane_3d< Type > > & | planes | ) | [static] |
Definition at line 328 of file vgl_homg_operators_3d.txx.
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 | ||
) | [inline, static] |
True if the points are closer than Euclidean distance d.
Definition at line 52 of file vgl_homg_operators_3d.h.
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 376 of file vgl_homg_operators_3d.txx.
vnl_vector_fixed< T, 4 > vgl_homg_operators_3d< T >::most_orthogonal_vector_svd | ( | const vcl_vector< vgl_homg_plane_3d< T > > & | planes | ) | [static] |
compute most orthogonal vector with SVD.
Definition at line 489 of file vgl_homg_operators_3d.txx.
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 : \[ d = {(l^ p)}{p_z{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 471 of file vgl_homg_operators_3d.txx.
static double vgl_homg_operators_3d< Type >::perp_dist_squared | ( | const vgl_homg_plane_3d< Type > & | plane, |
const vgl_homg_point_3d< Type > & | point | ||
) | [inline, static] |
Definition at line 67 of file vgl_homg_operators_3d.h.
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 140 of file vgl_homg_operators_3d.txx.
static double vgl_homg_operators_3d< Type >::perp_dist_squared | ( | const vgl_homg_point_3d< Type > & | point, |
const vgl_homg_line_3d & | line | ||
) | [inline, static] |
Definition at line 80 of file vgl_homg_operators_3d.h.
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 153 of file vgl_homg_operators_3d.txx.
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 187 of file vgl_homg_operators_3d.txx.
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 207 of file vgl_homg_operators_3d.txx.
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 221 of file vgl_homg_operators_3d.txx.
vgl_homg_point_3d< Type > vgl_homg_operators_3d< Type >::planes_to_point | ( | const vcl_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 that minimizes , where is the matrix whose rows are the planes. The implementation uses vnl_svd to accumulate and compute the nullspace of .
Definition at line 393 of file vgl_homg_operators_3d.txx.
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 359 of file vgl_homg_operators_3d.txx.