Image Component Library (ICL)
|
Line Equation structure. More...
#include <HoughLine.h>
Public Member Functions | |
HoughLine () | |
empty constructor (all line values are set to 0) More... | |
HoughLine (const utils::Point32f &offs, const utils::Point32f &dir) | |
create a line by given parameters More... | |
HoughLine (icl32f distance, icl32f angle) | |
create a line by given distance and angle More... | |
void | sample (core::ImgBase *image, icl32f r, icl32f g, icl32f b, icl32f alpha=255) const |
draws the line into an image More... | |
float | rho () const |
convenence function for transf. into IppPointPolar More... | |
float | theta () const |
convenence function for transf. into IppPointPolar More... | |
Static Public Member Functions | |
static utils::Point32f | getIntersection (const HoughLine &a, const HoughLine &b) |
Computes the intersection between two lines. More... | |
static std::vector< utils::Point32f > | getPairwiseIntersections (const std::vector< HoughLine > &lines) |
calculates all pairwise intersection within a set of lines More... | |
Static Public Attributes | |
static const utils::Point32f | NO_INTERSECTION |
indicator for no found intersection (lines intersect in infinity – max-float) More... | |
Private Attributes | |
float | m_distance |
float | m_angle |
utils::Point32f | m_offset |
utils::Point32f | m_direction |
Line Equation structure.
Lines can (among others) be represented in parameter form:
,or by given radius and angle .
This class provides both information.
icl::cv::HoughLine::HoughLine | ( | ) |
empty constructor (all line values are set to 0)
icl::cv::HoughLine::HoughLine | ( | const utils::Point32f & | offs, |
const utils::Point32f & | dir | ||
) |
create a line by given parameters
offs | offset vector |
dir | direction vector |
create a line by given distance and angle
distance | distance from the origin |
angle | angle of vector perpendicular to the line |
|
static |
Computes the intersection between two lines.
Assuming two lines given in polar coordinates
,
which can be seen geometrically, as a line that is perpendicular to the vector with distance r to the origin, we can calculate the intersection as follows:
Firstly, we have to transform the line equations into parameter form
(offset- and direction vector) using the following rules
This results in:
(using angle and distance ) and
(using angle and distance ) and
The intersection can be calculated by solving the equation system
, or in other words:
This is equal to
With
and
Of course can be solved by
If the lines do not intersect ( and are very similar), becomes singular and it's inverse cannot be calculated. This function returns NO_INTERSECTION in this case.
|
static |
calculates all pairwise intersection within a set of lines
|
inline |
convenence function for transf. into IppPointPolar
void icl::cv::HoughLine::sample | ( | core::ImgBase * | image, |
icl32f | r, | ||
icl32f | g, | ||
icl32f | b, | ||
icl32f | alpha = 255 |
||
) | const |
draws the line into an image
|
inline |
convenence function for transf. into IppPointPolar
|
private |
|
private |
|
private |
|
private |
|
static |
indicator for no found intersection (lines intersect in infinity – max-float)