Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

vgl_homg_operators_2d< T > Class Template Reference

#include <vgl_homg_operators_2d.h>

List of all members.


Detailed Description

template<class T>
class vgl_homg_operators_2d< T >

2D homogeneous operations.

Definition at line 31 of file vgl_homg_operators_2d.h.

Static Public Member Functions

static vnl_vector_fixed< T, 3 > get_vector (vgl_homg_point_2d< T > const &p)
 get a vnl_vector_fixed representation of a homogeneous object.
static vnl_vector_fixed< T, 3 > get_vector (vgl_homg_line_2d< T > const &l)
 get a vnl_vector_fixed representation of a homogeneous object.
static vnl_vector_fixed< T, 6 > get_vector (vgl_conic< T > const &c)
 get a vnl_vector_fixed representation of a homogeneous object.
static void unitize (vgl_homg_point_2d< T > &a)
 Normalize vgl_homg_point_2d<T> to unit magnitude.
static double angle_between_oriented_lines (const vgl_homg_line_2d< T > &line1, const vgl_homg_line_2d< T > &line2)
 Get the angle between two lines, a number between -PI and PI.
static double abs_angle (const vgl_homg_line_2d< T > &line1, const vgl_homg_line_2d< T > &line2)
 Get the 0 to pi/2 angle between two lines.
static T distance (const vgl_homg_point_2d< T > &point1, const vgl_homg_point_2d< T > &point2)
 Get the 2D distance between the two points.
static T distance_squared (const vgl_homg_point_2d< T > &point1, const vgl_homg_point_2d< T > &point2)
 Get the square of the 2D distance between the two points.
static T perp_dist_squared (const vgl_homg_point_2d< T > &point, const vgl_homg_line_2d< T > &line)
 Get the square of the perpendicular distance to a line.
static T perp_dist_squared (const vgl_homg_line_2d< T > &line, const vgl_homg_point_2d< T > &point)
static bool is_within_distance (const vgl_homg_point_2d< T > &p1, const vgl_homg_point_2d< T > &p2, double d)
 True if the points are closer than Euclidean distance d.
static double line_angle (const vgl_homg_line_2d< T > &line)
 Get the anticlockwise angle between a line and the x axis.
static vgl_homg_line_2d< T > join (const vgl_homg_point_2d< T > &point1, const vgl_homg_point_2d< T > &point2)
 Get the line through two points (the cross-product).
static vgl_homg_line_2d< T > join_oriented (const vgl_homg_point_2d< T > &point1, const vgl_homg_point_2d< T > &point2)
 Get the line through two points (the cross-product).
static vgl_homg_point_2d< T > intersection (const vgl_homg_line_2d< T > &line1, const vgl_homg_line_2d< T > &line2)
 Get the intersection point of two lines (the cross-product).
static vgl_homg_line_2d< T > perp_line_through_point (const vgl_homg_line_2d< T > &line, const vgl_homg_point_2d< T > &point)
 Get the perpendicular line to line which passes through point.
static vgl_homg_point_2d< T > perp_projection (const vgl_homg_line_2d< T > &line, const vgl_homg_point_2d< T > &point)
 Get the perpendicular projection of point onto line.
static vgl_homg_point_2d< T > midpoint (const vgl_homg_point_2d< T > &p1, const vgl_homg_point_2d< T > &p2)
 Return the midpoint of the line joining two homogeneous points.
static vgl_homg_point_2d< T > lines_to_point (const vcl_vector< vgl_homg_line_2d< T > > &lines)
 Intersect a set of 2D lines to find the least-square point of intersection.
static double cross_ratio (const vgl_homg_point_2d< T > &p1, const vgl_homg_point_2d< T > &p2, const vgl_homg_point_2d< T > &p3, const vgl_homg_point_2d< T > &p4)
 cross ratio of four collinear points.
static vgl_homg_point_2d< T > conjugate (const vgl_homg_point_2d< T > &a, const vgl_homg_point_2d< T > &b, const vgl_homg_point_2d< T > &c, double cr=-1.0)
 Conjugate point of three given collinear points.
static vnl_vector_fixed< T, 3 > most_orthogonal_vector (const vcl_vector< vgl_homg_line_2d< T > > &lines)
 compute most orthogonal vector with vnl_symmetric_eigensystem.
static vnl_vector_fixed< T, 3 > most_orthogonal_vector_svd (const vcl_vector< vgl_homg_line_2d< T > > &lines)
 compute most orthogonal vector with SVD.
static vgl_conic< T > vgl_conic_from_matrix (vnl_matrix_fixed< T, 3, 3 > const &mat)
 returns the vgl_conic which has the given matrix as its matrix.
static vnl_matrix_fixed< T, 3, 3 > matrix_from_conic (vgl_conic< T > const &)
 returns 3x3 matrix containing conic coefficients.
static vnl_matrix_fixed< T, 3, 3 > matrix_from_dual_conic (vgl_conic< T > const &)
 returns 3x3 matrix containing conic coefficients of dual conic.
static vcl_list< vgl_homg_point_2d<
T > > 
intersection (vgl_conic< T > const &c, vgl_homg_line_2d< T > const &l)
 Find all real intersection points of a conic and a line (between 0 and 2).
static vcl_list< vgl_homg_point_2d<
T > > 
intersection (vgl_conic< T > const &c1, vgl_conic< T > const &c2)
 Find all real intersection points of two conics (between 0 and 4).
static vcl_list< vgl_homg_line_2d<
T > > 
tangent_from (vgl_conic< T > const &c, vgl_homg_point_2d< T > const &p)
 Return the (at most) two tangent lines that pass through p and are tangent to the conic.
static vcl_list< vgl_homg_line_2d<
T > > 
common_tangents (vgl_conic< T > const &c1, vgl_conic< T > const &c2)
 Return the list of common tangent lines of two conics.
static vgl_homg_point_2d< T > closest_point (vgl_homg_line_2d< T > const &l, vgl_homg_point_2d< T > const &p)
 Return the point on the line closest to the given point.
static vgl_homg_point_2d< T > closest_point (vgl_conic< T > const &c, vgl_homg_point_2d< T > const &p)
 Return the point on the conic closest to the given point.
static vgl_homg_point_2d< T > closest_point (vgl_conic< T > const &c, vgl_point_2d< T > const &p)
 Return the point on the conic closest to the given point.
static T distance_squared (vgl_conic< T > const &c, vgl_homg_point_2d< T > const &p)
 Return the shortest squared distance between the conic and the point.
static vgl_box_2d< T > compute_bounding_box (vgl_conic< T > const &c)
 Compute the bounding box of an ellipse.

Static Private Member Functions

static vcl_list< vgl_homg_point_2d<
T > > 
do_intersect (vgl_conic< T > const &q, vgl_homg_line_2d< T > const &l)
static vcl_list< vgl_homg_point_2d<
T > > 
do_intersect (vgl_conic< T > const &c1, vgl_conic< T > const &c2)


Member Function Documentation

template<class T>
double vgl_homg_operators_2d< T >::abs_angle const vgl_homg_line_2d< T > &  line1,
const vgl_homg_line_2d< T > &  line2
[static]
 

Get the 0 to pi/2 angle between two lines.

Definition at line 163 of file vgl_homg_operators_2d.txx.

template<class T>
double vgl_homg_operators_2d< T >::angle_between_oriented_lines const vgl_homg_line_2d< T > &  line1,
const vgl_homg_line_2d< T > &  line2
[static]
 

Get the angle between two lines, a number between -PI and PI.

Although homogeneous coordinates are only defined up to scale, here it is assumed that a line with homogeneous coordinates (m) is at 180 degrees to a line (-m), and this is why the term "oriented_line" is used. However, the overall scale (apart from sign) is not significant.

Definition at line 186 of file vgl_homg_operators_2d.txx.

template<class T>
vgl_homg_point_2d< T > vgl_homg_operators_2d< T >::closest_point vgl_conic< T > const &  c,
vgl_point_2d< T > const &  pt
[static]
 

Return the point on the conic closest to the given point.

Still return a homogeneous point, even if the argument is non-homogeneous.

Definition at line 819 of file vgl_homg_operators_2d.txx.

template<class T>
vgl_homg_point_2d< T > vgl_homg_operators_2d< T >::closest_point vgl_conic< T > const &  c,
vgl_homg_point_2d< T > const &  p
[static]
 

Return the point on the conic closest to the given point.

Definition at line 756 of file vgl_homg_operators_2d.txx.

template<class T>
vgl_homg_point_2d< T > vgl_homg_operators_2d< T >::closest_point vgl_homg_line_2d< T > const &  l,
vgl_homg_point_2d< T > const &  p
[static]
 

Return the point on the line closest to the given point.

Definition at line 904 of file vgl_homg_operators_2d.txx.

template<class T>
vcl_list< vgl_homg_line_2d< T > > vgl_homg_operators_2d< T >::common_tangents vgl_conic< T > const &  c1,
vgl_conic< T > const &  c2
[static]
 

Return the list of common tangent lines of two conics.

This is done by finding the intersection points of the two dual conics, which are the duals of the common tangent lines. If one of the conics is degenerate, an empty list is returned.

Definition at line 736 of file vgl_homg_operators_2d.txx.

template<class T>
vgl_box_2d< T > vgl_homg_operators_2d< T >::compute_bounding_box vgl_conic< T > const &  c  )  [static]
 

Compute the bounding box of an ellipse.

This is done by finding the tangent lines to the ellipse from the two points at infinity (1,0,0) and (0,1,0).

Definition at line 830 of file vgl_homg_operators_2d.txx.

template<class T>
vgl_homg_point_2d< T > vgl_homg_operators_2d< T >::conjugate const vgl_homg_point_2d< T > &  a,
const vgl_homg_point_2d< T > &  b,
const vgl_homg_point_2d< 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.

Definition at line 384 of file vgl_homg_operators_2d.txx.

template<class T>
double cross_ratio const vgl_homg_point_2d< T > &  p1,
const vgl_homg_point_2d< T > &  p2,
const vgl_homg_point_2d< T > &  p3,
const vgl_homg_point_2d< T > &  p4
[static]
 

cross ratio of four collinear points.

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 361 of file vgl_homg_operators_2d.txx.

template<class T>
T vgl_homg_operators_2d< T >::distance const vgl_homg_point_2d< T > &  point1,
const vgl_homg_point_2d< T > &  point2
[static]
 

Get the 2D distance between the two points.

Definition at line 102 of file vgl_homg_operators_2d.txx.

template<class T>
static T vgl_homg_operators_2d< T >::distance_squared vgl_conic< T > const &  c,
vgl_homg_point_2d< T > const &  p
[inline, static]
 

Return the shortest squared distance between the conic and the point.

Definition at line 192 of file vgl_homg_operators_2d.h.

template<class T>
T vgl_homg_operators_2d< T >::distance_squared const vgl_homg_point_2d< T > &  point1,
const vgl_homg_point_2d< T > &  point2
[static]
 

Get the square of the 2D distance between the two points.

Definition at line 110 of file vgl_homg_operators_2d.txx.

template<class T>
vcl_list< vgl_homg_point_2d< T > > vgl_homg_operators_2d< T >::do_intersect vgl_conic< T > const &  c1,
vgl_conic< T > const &  c2
[static, private]
 

Definition at line 455 of file vgl_homg_operators_2d.txx.

template<class T>
vcl_list< vgl_homg_point_2d< T > > vgl_homg_operators_2d< T >::do_intersect vgl_conic< T > const &  q,
vgl_homg_line_2d< T > const &  l
[static, private]
 

Definition at line 567 of file vgl_homg_operators_2d.txx.

template<class T>
vnl_vector_fixed< T, 6 > vgl_homg_operators_2d< T >::get_vector vgl_conic< T > const &  c  )  [static]
 

get a vnl_vector_fixed representation of a homogeneous object.

Definition at line 70 of file vgl_homg_operators_2d.txx.

template<class T>
vnl_vector_fixed< T, 3 > vgl_homg_operators_2d< T >::get_vector vgl_homg_line_2d< T > const &  l  )  [static]
 

get a vnl_vector_fixed representation of a homogeneous object.

Definition at line 64 of file vgl_homg_operators_2d.txx.

template<class T>
vnl_vector_fixed< T, 3 > vgl_homg_operators_2d< T >::get_vector vgl_homg_point_2d< T > const &  p  )  [static]
 

get a vnl_vector_fixed representation of a homogeneous object.

Definition at line 58 of file vgl_homg_operators_2d.txx.

template<class T>
vcl_list< vgl_homg_point_2d< T > > vgl_homg_operators_2d< T >::intersection vgl_conic< T > const &  c1,
vgl_conic< T > const &  c2
[static]
 

Find all real intersection points of two conics (between 0 and 4).

The returned points have protection level 0.

Definition at line 656 of file vgl_homg_operators_2d.txx.

template<class T>
vcl_list< vgl_homg_point_2d< T > > vgl_homg_operators_2d< T >::intersection vgl_conic< T > const &  c,
vgl_homg_line_2d< T > const &  l
[static]
 

Find all real intersection points of a conic and a line (between 0 and 2).

Definition at line 626 of file vgl_homg_operators_2d.txx.

template<class T>
vgl_homg_point_2d< T > vgl_homg_operators_2d< T >::intersection const vgl_homg_line_2d< T > &  line1,
const vgl_homg_line_2d< T > &  line2
[static]
 

Get the intersection point of two lines (the cross-product).

Definition at line 231 of file vgl_homg_operators_2d.txx.

template<class T>
static bool vgl_homg_operators_2d< T >::is_within_distance const vgl_homg_point_2d< T > &  p1,
const vgl_homg_point_2d< T > &  p2,
double  d
[inline, static]
 

True if the points are closer than Euclidean distance d.

Definition at line 73 of file vgl_homg_operators_2d.h.

template<class T>
vgl_homg_line_2d< T > vgl_homg_operators_2d< T >::join const vgl_homg_point_2d< T > &  point1,
const vgl_homg_point_2d< T > &  point2
[static]
 

Get the line through two points (the cross-product).

Definition at line 201 of file vgl_homg_operators_2d.txx.

template<class T>
vgl_homg_line_2d< T > vgl_homg_operators_2d< T >::join_oriented const vgl_homg_point_2d< T > &  point1,
const vgl_homg_point_2d< T > &  point2
[static]
 

Get the line through two points (the cross-product).

In this case, we assume that the points are oriented, and ensure the cross is computed with positive point omegas.

Definition at line 214 of file vgl_homg_operators_2d.txx.

template<class T>
double vgl_homg_operators_2d< T >::line_angle const vgl_homg_line_2d< T > &  line  )  [static]
 

Get the anticlockwise angle between a line and the x axis.

Definition at line 154 of file vgl_homg_operators_2d.txx.

template<class T>
vgl_homg_point_2d< T > vgl_homg_operators_2d< T >::lines_to_point const vcl_vector< vgl_homg_line_2d< T > > &  lines  )  [static]
 

Intersect a set of 2D lines 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 lines. The implementation uses either vnl_scatter_3x3 (default) or vnl_svd (when at compile time VGL_HOMG_OPERATORS_2D_LINES_TO_POINT_USE_SVD has been set) to accumulate and compute the nullspace of $\tt L^\top \tt L$ .

Definition at line 326 of file vgl_homg_operators_2d.txx.

template<class T>
vnl_matrix_fixed< T, 3, 3 > vgl_homg_operators_2d< T >::matrix_from_conic vgl_conic< T > const &  c  )  [static]
 

returns 3x3 matrix containing conic coefficients.

   [A,B,C,D,E,F] ->   [ A  B/2 D/2 ]
                      [ B/2 C  E/2 ]
                      [ D/2 E/2 F  ]
   

Definition at line 420 of file vgl_homg_operators_2d.txx.

template<class T>
vnl_matrix_fixed< T, 3, 3 > vgl_homg_operators_2d< T >::matrix_from_dual_conic vgl_conic< T > const &  c  )  [static]
 

returns 3x3 matrix containing conic coefficients of dual conic.

I.e., the inverse matrix (up to a scale factor) of the conic matrix.

Definition at line 439 of file vgl_homg_operators_2d.txx.

template<class T>
vgl_homg_point_2d< T > vgl_homg_operators_2d< T >::midpoint const vgl_homg_point_2d< T > &  p1,
const vgl_homg_point_2d< T > &  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) is returned.

Definition at line 272 of file vgl_homg_operators_2d.txx.

template<class T>
vnl_vector_fixed< T, 3 > vgl_homg_operators_2d< T >::most_orthogonal_vector const vcl_vector< vgl_homg_line_2d< T > > &  lines  )  [static]
 

compute most orthogonal vector with vnl_symmetric_eigensystem.

Definition at line 287 of file vgl_homg_operators_2d.txx.

template<class T>
vnl_vector_fixed< T, 3 > vgl_homg_operators_2d< T >::most_orthogonal_vector_svd const vcl_vector< vgl_homg_line_2d< T > > &  lines  )  [static]
 

compute most orthogonal vector with SVD.

Definition at line 302 of file vgl_homg_operators_2d.txx.

template<class T>
static T vgl_homg_operators_2d< T >::perp_dist_squared const vgl_homg_line_2d< T > &  line,
const vgl_homg_point_2d< T > &  point
[inline, static]
 

Definition at line 68 of file vgl_homg_operators_2d.h.

template<class T>
T vgl_homg_operators_2d< T >::perp_dist_squared const vgl_homg_point_2d< T > &  point,
const vgl_homg_line_2d< T > &  line
[static]
 

Get the square of the perpendicular distance to a line.

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

Definition at line 132 of file vgl_homg_operators_2d.txx.

template<class T>
vgl_homg_line_2d< T > vgl_homg_operators_2d< T >::perp_line_through_point const vgl_homg_line_2d< T > &  line,
const vgl_homg_point_2d< T > &  point
[static]
 

Get the perpendicular line to line which passes through point.

Params are line $(a,b,c)$ and point $(x,y,1)$ . Then the cross product of $(x,y,1)$ and the line's direction $(a,b,0)$ , called $(p,q,r)$ satisfies

$ap+bq=0$ (perpendicular condition) and

$px+qy+r=0$ (incidence condition).

Definition at line 247 of file vgl_homg_operators_2d.txx.

template<class T>
vgl_homg_point_2d< T > vgl_homg_operators_2d< T >::perp_projection const vgl_homg_line_2d< T > &  line,
const vgl_homg_point_2d< T > &  point
[static]
 

Get the perpendicular projection of point onto line.

Definition at line 259 of file vgl_homg_operators_2d.txx.

template<class T>
vcl_list< vgl_homg_line_2d< T > > vgl_homg_operators_2d< T >::tangent_from vgl_conic< T > const &  c,
vgl_homg_point_2d< T > const &  p
[static]
 

Return the (at most) two tangent lines that pass through p and are tangent to the conic.

For points on the conic, exactly 1 line is returned: the tangent at that point. For points inside the conic, an empty list is returned. For points outside the conic, there are always two tangents returned. Found by intersecting the dual conic with the dual line. If the conic is degenerate, an empty list is returned, unless the point is on the conic (in which case the component is returned to which it belongs, or even both components in the exclusive case that the point is the centre).

Definition at line 704 of file vgl_homg_operators_2d.txx.

template<class T>
void vgl_homg_operators_2d< T >::unitize vgl_homg_point_2d< T > &  a  )  [static]
 

Normalize vgl_homg_point_2d<T> to unit magnitude.

Definition at line 86 of file vgl_homg_operators_2d.txx.

template<class T>
vgl_conic< T > vgl_homg_operators_2d< T >::vgl_conic_from_matrix vnl_matrix_fixed< T, 3, 3 > const &  mat  )  [static]
 

returns the vgl_conic which has the given matrix as its matrix.

   [A,B,C,D,E,F] <-   [ A  B/2 D/2 ]
                      [ B/2 C  E/2 ]
                      [ D/2 E/2 F  ]
   

Definition at line 406 of file vgl_homg_operators_2d.txx.


The documentation for this class was generated from the following files:
Generated on Thu Jan 10 14:39:27 2008 for core/vgl by  doxygen 1.4.4