Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
BIAS::Conic2D Class Reference

A 3x3 matrix representing a conic (cone/plane intersection) More...

#include <Geometry/Conic2D.hh>

+ Inheritance diagram for BIAS::Conic2D:
+ Collaboration diagram for BIAS::Conic2D:

Public Types

enum  ConicType {
  Unknown =0, WholePlane, Ellipse, Parabola,
  Hyperbola, SingleLine, DoubleLine, Point,
  Empty
}
 

Public Member Functions

void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
 Conic2D ()
 default constructor sets all fields to zero More...
 
 Conic2D (const MatrixInitType &i)
 set default matrix values More...
 
 Conic2D (const Matrix3x3< CONIC2D_TYPE > &m)
 copy constructor uses Conic2D::operator= More...
 
 Conic2D (const Matrix< CONIC2D_TYPE > &m)
 copy constructor uses Conic2D::operator= More...
 
bool DebugLevelIsSet (const long int lv) const
 
bool DebugLevelIsSet (const std::string &name) const
 
void Draw (Image< unsigned char > &img) const
 draws conic into an image using a brute force method More...
 
bool EllipsoidSilhouetteToGauss (const double &ProbBorder, HomgPoint2D &Center, double &NormalizationFactor)
 assign a probability of a gaussian distribution to a conic to measure probabilities in the image plane More...
 
void GetAbsMaxMin (CONIC2D_TYPE &max, CONIC2D_TYPE &min) const
 
void GetColumn (const unsigned int col, Vector3< CONIC2D_TYPE > &r) const
 extract one column ('Spalte') from this matrix (for convenience) More...
 
BIAS::Vector3< CONIC2D_TYPE > GetColumn (const unsigned int col) const
 
ConicType GetConicType () const
 return the type of point conic of (*this) More...
 
CONIC2D_TYPE * GetData ()
 
const CONIC2D_TYPE * GetData () const
 
int GetDebugLevel () const
 
std::ostream & GetDebugStream () const
 
void GetDebugStream (std::ostream &os) const
 
CONIC2D_TYPE GetDeterminant () const
 returns the Determinant |A| of this More...
 
Conic2D GetDualConic (bool UseSVD=false) const
 returns the dual of this conic, which is the inverse More...
 
bool GetEllipseParameters (HomgPoint2D &Center, double &dAngle, double &radius_a, double &radius_b) const
 computes explicit ellipse representation More...
 
bool GetEllipseParameters (double center[2], double a[2], double b[2]) const
 returns the center and the two halfaxes of the conic if feasible (f.e. More...
 
int GetInverse (Matrix3x3< CONIC2D_TYPE > &inv) const
 Matrix inversion: inverts this and stores resulty in argument inv. More...
 
int GetLinearizedOffset (const HomgPoint2D &point, HomgPoint2D &distance, const HomgPoint2DCov &pointcov=HomgPoint2DCov(MatrixIdentity)) const
 compute approximate offset of a measured point to a known conic More...
 
int GetLines (std::vector< HomgLine2D > &lines) const
 retrieve one or two lines from a degenerate point conic More...
 
CONIC2D_TYPE GetMax () const
 
void GetMaxMin (CONIC2D_TYPE &max, CONIC2D_TYPE &min) const
 return biggest and smallest entry More...
 
CONIC2D_TYPE GetMin () const
 
unsigned GetNumElements () const
 
int GetPoint (HomgPoint2D &thepoint) const
 if the conic consists of a single point (degenerate case, rank=2) retrieve this point More...
 
bool GetPointAndCovariance (HomgPoint2D &center, Matrix2x2< CONIC2D_TYPE > &cov) const
 reconstructs center and covariance matrix from conic More...
 
double GetPointDistance (const HomgPoint2D &point, HomgPoint2D &distance, const HomgPoint2DCov &pointcov=HomgPoint2DCov(MatrixIdentity)) const
 return the squared mahalanobis distance of the point to the conic More...
 
void GetRow (const unsigned int row, Vector3< CONIC2D_TYPE > &r) const
 extract one row ('Zeile') from ths matrix (for convenience) More...
 
Vector3< CONIC2D_TYPE > GetRow (const unsigned int row) const
 
unsigned int GetSignature () const
 computes signature of matrix, (no. More...
 
int GetTangentPoints (const HomgPoint2D &x, HomgPoint2D &p1, HomgPoint2D &p2) const
 Returns the two points p1 and p2 on the conic subject to the constraint that the two tangents at the points p1 and p2 intersect in the point x. More...
 
int IntersectConic (const Conic2D &otherconic, std::vector< HomgPoint2D > &intersectionPoints) const
 compute intersection of 2 conics More...
 
int IntersectConicProper (const Conic2D &otherconic, std::vector< HomgPoint2D > &intersectionPoints) const
 compute intersection of 2 non-degenerate (full-rank) conics More...
 
int IntersectLine (const HomgLine2D &theline, std::vector< HomgPoint2D > &intersectionPoints) const
 compute intersection of a conic with a line More...
 
bool IntersectsCircle (const HomgPoint2D &C, double Radius) const
 returns true if the given Conic intersects with the circle of radius Radius around point C, false otherwise More...
 
int InvertIP ()
 In place matrix conversion. More...
 
bool IsDoubleLine () const
 check whether this conic is a double line More...
 
bool IsEllipse () const
 check whether this conic is an ellipse More...
 
bool IsEmpty () const
 check whether this conic contains no points More...
 
bool IsHyperbola () const
 check whether this conic is a hyperbola More...
 
bool IsIdentity (const CONIC2D_TYPEeps=std::numeric_limits< CONIC2D_TYPE >::epsilon()) const
 
bool IsParabola () const
 check whether this conic is a parabola More...
 
bool IsPoint () const
 check whether this conic is a point More...
 
bool IsProper () const
 is this a proper conic (parabola/hyperbola/ellipse) with rank3 or some of the degenerate cases ? More...
 
bool IsSingleLine () const
 check whether this conic is a single line More...
 
bool IsZero (const CONIC2D_TYPEeps=std::numeric_limits< CONIC2D_TYPE >::epsilon()) const
 
bool Load (const std::string &fname)
 
double LocatePoint (const HomgPoint2D &point2D) const
 determines if the point is inside/on/outside the conic More...
 
void MakeSymmetric ()
 
void Mult (const Vector3< CONIC2D_TYPE > &argvec, Vector3< CONIC2D_TYPE > &destvec) const
 matrix - vector multiplicate this matrix with Vector3, storing the result in destvec calculates: destvec = (this Matrix) * argvec More...
 
void Mult (const Matrix3x3< CONIC2D_TYPE > &argmat, Matrix3x3< CONIC2D_TYPE > &destmat) const
 matrix-matrix multiplication with other Matrix3x3, storing the result in destmat calculates: destmat = (this mat) * argmat More...
 
void Mult (const Matrix3x4< CONIC2D_TYPE > &argmat, Matrix3x4< CONIC2D_TYPE > &destmat) const
 
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found More...
 
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel More...
 
bool Normalize ()
 sets mean of first 2 diag elements to positive value, so that LocatePoint(x)<0 means x is in conic More...
 
double NormFrobenius () const
 
CONIC2D_TYPE NormL1 () const
 
double NormL2 () const
 
bool operator!= (const Matrix3x3< CONIC2D_TYPE > &arg) const
 
Matrix3x3< CONIC2D_TYPE > & operator*= (const Matrix3x3< CONIC2D_TYPE > &arg)
 woelk 11/2007 (c) www.vision-n.de More...
 
Matrix3x3< CONIC2D_TYPE > & operator*= (const CONIC2D_TYPE &arg)
 woelk 11/2007 (c) www.vision-n.de More...
 
Matrix3x3< CONIC2D_TYPE > & operator+= (const Matrix3x3< CONIC2D_TYPE > &arg)
 
Matrix3x3< CONIC2D_TYPE > & operator-= (const Matrix3x3< CONIC2D_TYPE > &arg)
 
Matrix3x3< CONIC2D_TYPE > & operator/= (const CONIC2D_TYPE &arg)
 
Conic2Doperator= (const Matrix< CONIC2D_TYPE > &m)
 
bool operator== (const Matrix3x3< CONIC2D_TYPE > &arg) const
 
CONIC2D_TYPE * operator[] (const unsigned row)
 
const CONIC2D_TYPE * operator[] (const unsigned row) const
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
bool Save (const std::string &fname) const
 
void Scale (const CONIC2D_TYPE &scalar, Matrix3x3< CONIC2D_TYPE > &destmat) const
 scalar-matrix multiplication More...
 
void SetAsCrossProductMatrix (const Vector3< CONIC2D_TYPE > &vec)
 Sets matrix from vector as cross product matrix of this vector. More...
 
void SetAsCrossProductMatrix (const CONIC2D_TYPE &x, const CONIC2D_TYPE &y, const CONIC2D_TYPE &z)
 Sets matrix from vector as cross product matrix of a vector. More...
 
void SetColumn (const unsigned int col, const Vector3< CONIC2D_TYPE > &c)
 
void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
void SetEllipse (const HomgPoint2D &Center, const double &dAngle, const double &radius_a, const double &radius_b)
 construct an ellipse with explicit parameters More...
 
void SetFromColumnVectors (const BIAS::Vector3< CONIC2D_TYPE > &v0, const BIAS::Vector3< CONIC2D_TYPE > &v1, const BIAS::Vector3< CONIC2D_TYPE > &v2)
 set this matrix from 3 vectors each representating a column More...
 
void SetFromRowVectors (const BIAS::Vector3< CONIC2D_TYPE > &v0, const BIAS::Vector3< CONIC2D_TYPE > &v1, const BIAS::Vector3< CONIC2D_TYPE > &v2)
 set this matrix from 3 vectors, each representating a row More...
 
void SetFromVector (const TNT::Vector< CONIC2D_TYPE > &vec)
 sets the diagonalelements of this 3x3 Matrix rowwise with the values of the 9 (x1) vector More...
 
void SetIdentity ()
 set the elements of this matrix to the identity matrix (possibly overriding the inherited method) More...
 
void SetPointAndCovariance (const HomgPoint2D &center, const Matrix2x2< CONIC2D_TYPE > &cov, const double &dScale=GAUSS2D_CONFIDENCE_39_PERCENT)
 constructs a conic from a point and a covariance matrix More...
 
void SetQuadricProjection (const Quadric3D &Q, const PMatrix &P, bool UseSVD=false)
 constructs a conic that is a projection of the quadric Q using camera matrix P More...
 
void SetRow (const unsigned int row, const Vector3< CONIC2D_TYPE > &r)
 
void SetSingleLine (HomgLine2D theline)
 create a degenerate point conic consisting only of one line More...
 
void SetTwoLines (HomgLine2D theline1, HomgLine2D theline2)
 create a degenerate point conic consisting of two lines More...
 
void SetZero ()
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 
CONIC2D_TYPE Trace () const
 return the trace of the matrix More...
 
Matrix3x3< CONIC2D_TYPE > Transpose () const
 returns transposed matrix tested 12.06.2002 More...
 
void Transpose (const Matrix3x3< CONIC2D_TYPE > &arg)
 sets this as transposed arg, fw More...
 
void TransposedMult (const Vector3< CONIC2D_TYPE > &argvec, Vector3< CONIC2D_TYPE > &destvec) const
 multiplies matrix from left with transposed argvec, resulting in transposed destvec More...
 
void TransposeIP ()
 tranpose this matrix "in place" example: 0 1 2 –> 0 3 6 3 4 5 –> 1 4 7 6 7 8 –> 2 5 8 More...
 

Static Public Member Functions

static long int GetGlobalDebugLevel ()
 
static void SetGlobalDebugLevel (long int lev)
 

Protected Member Functions

long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 
double GetDiscriminant () const
 

Protected Attributes

long int _liDebugLevel
 
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class More...
 
std::map< std::string, long int > _String2Debuglevel
 
CONIC2D_TYPE Data_ [9]
 

Static Protected Attributes

static std::ostream _zDebugStream
 
static long int GlobalDebugLevel = 0
 

Detailed Description

A 3x3 matrix representing a conic (cone/plane intersection)

A conic is a (contour) line in P2, which resulted from the projection of a quadric (see Quadric3D) of P3. Conics are ellipses, hyperbolas, ... Each point x of the conic C fulfills x^T C x = 0 which is a quadratic equation in the components of x. If nothing else is mentioned, we mean point conics, not line conics.

Author
koeser, 10/2003
Examples:
ExampleConic.cpp, and ExampleDrawConic.cpp.

Definition at line 71 of file Conic2D.hh.

Member Enumeration Documentation

Enumerator
Unknown 
WholePlane 
Ellipse 
Parabola 
Hyperbola 
SingleLine 
DoubleLine 
Point 
Empty 

Definition at line 76 of file Conic2D.hh.

Constructor & Destructor Documentation

BIAS::Conic2D::Conic2D ( )
inline

default constructor sets all fields to zero

Definition at line 80 of file Conic2D.hh.

BIAS::Conic2D::Conic2D ( const MatrixInitType i)
inlineexplicit

set default matrix values

Definition at line 83 of file Conic2D.hh.

BIAS::Conic2D::Conic2D ( const Matrix3x3< CONIC2D_TYPE > &  m)
inline

copy constructor uses Conic2D::operator=

Definition at line 87 of file Conic2D.hh.

References BIAS::Matrix3x3< T >::operator=().

BIAS::Conic2D::Conic2D ( const Matrix< CONIC2D_TYPE > &  m)
inline

copy constructor uses Conic2D::operator=

Definition at line 91 of file Conic2D.hh.

References BIAS::Matrix3x3< T >::operator=().

Member Function Documentation

void BIAS::Debug::AddDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::AddDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 362 of file Debug.hh.

long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( )
inlineprotectedinherited

returns the next available debuglevel

Author
woelk 09/2006

Definition at line 521 of file Debug.hh.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const
inlineinherited
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const
inlineinherited

Definition at line 350 of file Debug.hh.

void Conic2D::Draw ( Image< unsigned char > &  img) const

draws conic into an image using a brute force method

Runs across all pixels and checks for zero crossings of LocatePoint. Really slow, but works for ANY type. If the conic is an ellipse, a more elegant way of drawing can be found in ImageDraw

Examples:
ExampleConic.cpp, and ExampleDrawConic.cpp.

Definition at line 221 of file Conic2D.cpp.

References BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), and BIAS::HomgPoint2D::Homogenize().

bool Conic2D::EllipsoidSilhouetteToGauss ( const double &  ProbBorder,
HomgPoint2D Center,
double &  NormalizationFactor 
)

assign a probability of a gaussian distribution to a conic to measure probabilities in the image plane

Ellipsoids in 3D space represent iso surfaces of gaussian normal distributions (e.g. of the 99% volume). Projecting a silhouette of such an ellipsoid gives a conic (e.g. an ellipse) in the image. If we want to interpret the conic as the covariance matrix of a gauss within the image plane, we have to convert it in such a way that the ellipse center yields zero and the border (the former conic line) a different value than zero, e.g. a value corresponding to 99%.

Afterwards, you can simply compute NormalizationFactor * exp(this->LocatePoint(x)) to compute the probability at x

still have to test this !

Definition at line 500 of file Conic2D.cpp.

void BIAS::Matrix3x3< CONIC2D_TYPE >::GetAbsMaxMin ( CONIC2D_TYPE &  max,
CONIC2D_TYPE &  min 
) const
inherited
Author
woelk 11/2007 (c) www.vision-n.de
void BIAS::Matrix3x3< CONIC2D_TYPE >::GetColumn ( const unsigned int  col,
Vector3< CONIC2D_TYPE > &  r 
) const
inherited

extract one column ('Spalte') from this matrix (for convenience)

BIAS::Vector3<CONIC2D_TYPE > BIAS::Matrix3x3< CONIC2D_TYPE >::GetColumn ( const unsigned int  col) const
inlineinherited

Definition at line 202 of file Matrix3x3.hh.

Conic2D::ConicType Conic2D::GetConicType ( ) const

return the type of point conic of (*this)

Definition at line 186 of file Conic2D.cpp.

References DoubleLine, Ellipse, Empty, Hyperbola, Parabola, Point, SingleLine, and WholePlane.

Referenced by GetLines(), and IntersectConic().

CONIC2D_TYPE * BIAS::Matrix3x3< CONIC2D_TYPE >::GetData ( )
inlineinherited
Author
woelk 11/2007 (c) www.vision-n.de

Definition at line 99 of file Matrix3x3.hh.

const CONIC2D_TYPE * BIAS::Matrix3x3< CONIC2D_TYPE >::GetData ( ) const
inlineinherited
Author
woelk 11/2007 (c) www.vision-n.de

Definition at line 103 of file Matrix3x3.hh.

int BIAS::Debug::GetDebugLevel ( ) const
inlineinherited
std::ostream& BIAS::Debug::GetDebugStream ( ) const
inlineinherited

Definition at line 405 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const
inlineinherited

Definition at line 414 of file Debug.hh.

CONIC2D_TYPE BIAS::Matrix3x3< CONIC2D_TYPE >::GetDeterminant ( ) const
inherited

returns the Determinant |A| of this

Author
grest
double Conic2D::GetDiscriminant ( ) const
protected
Returns
a value classifying the conic:
  • Discriminant<0: hyperbola
  • (Discriminant=0: parabola ?)
  • Discriminant>0: ellipse

Definition at line 43 of file Conic2D.cpp.

Conic2D Conic2D::GetDualConic ( bool  UseSVD = false) const
bool Conic2D::GetEllipseParameters ( HomgPoint2D Center,
double &  dAngle,
double &  radius_a,
double &  radius_b 
) const

computes explicit ellipse representation

if the given conic is an ellipse, the ellipse parameters are extracted and returned in the functions parameters

Parameters
dAnglerotation angle in radiant (math. positive)
radius_aradius in (originally) x direction
radius_bradius in (originally) y direction
Returns
returned parameters are only valid if true is returned, otherwise (*this) is no (or a degenerate) ellipse
Examples:
ExampleConic.cpp.

Definition at line 432 of file Conic2D.cpp.

bool Conic2D::GetEllipseParameters ( double  center[2],
double  a[2],
double  b[2] 
) const

returns the center and the two halfaxes of the conic if feasible (f.e.

for drawing with the class ImageDraw)

Author
woelk 06/2005

Definition at line 400 of file Conic2D.cpp.

References BIAS::Matrix2x2< T >::EigenvalueDecomposition().

static long int BIAS::Debug::GetGlobalDebugLevel ( )
inlinestaticinherited

Definition at line 431 of file Debug.hh.

int BIAS::Matrix3x3< CONIC2D_TYPE >::GetInverse ( Matrix3x3< CONIC2D_TYPE > &  inv) const
inherited

Matrix inversion: inverts this and stores resulty in argument inv.

Returns -1 if determinant is zero, 0 on success.

Author
woelk 07/2005
int Conic2D::GetLinearizedOffset ( const HomgPoint2D point,
HomgPoint2D distance,
const HomgPoint2DCov pointcov = HomgPoint2DCov(MatrixIdentity) 
) const

compute approximate offset of a measured point to a known conic

This uses the linearization of a quadratic equation under the assumption that the point is close to the conic. With increasing outside distance to the conic, the offset is underestimated. See [Kanatani96:Statistical Optimization..., p.169]

Author
koeser 02/2009

Definition at line 1297 of file Conic2D.cpp.

References BIAS::Matrix3x3< T >::Mult(), BIAS::Vector3< T >::NormL2(), and BIAS::Vector3< T >::ScalarProduct().

int Conic2D::GetLines ( std::vector< HomgLine2D > &  lines) const

retrieve one or two lines from a degenerate point conic

Returns
0 lines contains all lines, other values indicate an error, e.g. the conic does not consist of two lines

Definition at line 865 of file Conic2D.cpp.

References BIAS::Matrix2x2< T >::det(), GetConicType(), BIAS::Vector3< T >::GetSkewSymmetricMatrix(), BIAS::Matrix3x3< T >::NormFrobenius(), BIAS::Vector3< T >::NormL2(), BIAS::Matrix3x3< T >::NormL2(), BIAS::Vector3< T >::OuterProduct(), and BIAS::Matrix3x3< T >::Transpose().

Referenced by IntersectConic(), and IntersectConicProper().

CONIC2D_TYPE BIAS::Matrix3x3< CONIC2D_TYPE >::GetMax ( ) const
inherited
Author
woelk 11/2007 (c) www.vision-n.de
void BIAS::Matrix3x3< CONIC2D_TYPE >::GetMaxMin ( CONIC2D_TYPE &  max,
CONIC2D_TYPE &  min 
) const
inherited

return biggest and smallest entry

Author
woelk 08/2004
CONIC2D_TYPE BIAS::Matrix3x3< CONIC2D_TYPE >::GetMin ( ) const
inherited
Author
woelk 11/2007 (c) www.vision-n.de
unsigned BIAS::Matrix3x3< CONIC2D_TYPE >::GetNumElements ( ) const
inlineinherited
Author
woelk 11/2007 (c) www.vision-n.de

Definition at line 107 of file Matrix3x3.hh.

int Conic2D::GetPoint ( HomgPoint2D thepoint) const

if the conic consists of a single point (degenerate case, rank=2) retrieve this point

Definition at line 211 of file Conic2D.cpp.

References BIAS::SVD::GetNullvector(), BIAS::HomgPoint2D::Homogenize(), and BIAS::Vector3< T >::Normalize().

Referenced by IntersectConic().

bool Conic2D::GetPointAndCovariance ( HomgPoint2D center,
Matrix2x2< CONIC2D_TYPE > &  cov 
) const

reconstructs center and covariance matrix from conic

Author
woelk 06/2005

Definition at line 368 of file Conic2D.cpp.

double Conic2D::GetPointDistance ( const HomgPoint2D point,
HomgPoint2D distance,
const HomgPoint2DCov pointcov = HomgPoint2DCov(MatrixIdentity) 
) const

return the squared mahalanobis distance of the point to the conic

This function can be used for the decision whether a noisy point lies on a conic curve or not (e.g. threshold the result at 4.0).

Returns
If point is an observation from a normal distribution with its mean on the conic curve than the resulting squared mahalanobis distance is 1D chi-squared distributed. This means e.g. less than 5% of all such points will have a distance larger than 4 (this is the "2-sigma-band").
Author
koeser

Definition at line 1316 of file Conic2D.cpp.

References BIAS::Vector3< T >::ScalarProduct().

void BIAS::Matrix3x3< CONIC2D_TYPE >::GetRow ( const unsigned int  row,
Vector3< CONIC2D_TYPE > &  r 
) const
inherited

extract one row ('Zeile') from ths matrix (for convenience)

Vector3<CONIC2D_TYPE > BIAS::Matrix3x3< CONIC2D_TYPE >::GetRow ( const unsigned int  row) const
inlineinherited

Definition at line 196 of file Matrix3x3.hh.

unsigned int Conic2D::GetSignature ( ) const

computes signature of matrix, (no.

of neg. eigenvalues) - (no. of pos. eigenvalues) or vice versa if there are more pos. eigenvalues

Definition at line 550 of file Conic2D.cpp.

References BIAS::Matrix3x3< T >::GetRow(), BIAS::SVD::GetS(), and BIAS::SVD::GetVT().

int Conic2D::GetTangentPoints ( const HomgPoint2D x,
HomgPoint2D p1,
HomgPoint2D p2 
) const

Returns the two points p1 and p2 on the conic subject to the constraint that the two tangents at the points p1 and p2 intersect in the point x.

Returns the number of tangent points (1 or 2) or -1 on error

Author
woelk 06/2005

Definition at line 725 of file Conic2D.cpp.

References BIAS::HomgPoint2D::Set(), and BIAS::Matrix3x3< T >::SetAsCrossProductMatrix().

int Conic2D::IntersectConic ( const Conic2D otherconic,
std::vector< HomgPoint2D > &  intersectionPoints 
) const

compute intersection of 2 conics

Author
koeser 02/2008
Returns
0: intersectionPoints contains all intersections, other: degenerate case (infinite solutions)

Definition at line 1019 of file Conic2D.cpp.

References BIAS::Equal(), GetConicType(), GetLines(), GetPoint(), IntersectConic(), IntersectLine(), IsEmpty(), IsPoint(), IsProper(), LocatePoint(), BIAS::Vector3< T >::NormL2(), and BIAS::Point.

Referenced by IntersectConic().

int Conic2D::IntersectConicProper ( const Conic2D otherconic,
std::vector< HomgPoint2D > &  intersectionPoints 
) const

compute intersection of 2 non-degenerate (full-rank) conics

Author
koeser 02/2008
Returns
0: intersectionPoints contains all intersections, other: degenerate case or conics are equal

Definition at line 1112 of file Conic2D.cpp.

References BIAS::Equal(), BIAS::FMatrixEstimation::GetDetPolynomial(), GetLines(), IsProper(), BIAS::Matrix3x3< T >::NormFrobenius(), and BIAS::PolynomialSolve::Solve().

int Conic2D::IntersectLine ( const HomgLine2D theline,
std::vector< HomgPoint2D > &  intersectionPoints 
) const

compute intersection of a conic with a line

Author
koeser 02/2008
Returns
0: intersectionPoints contains all intersections, other: degenerate case or conics are equal

Definition at line 1206 of file Conic2D.cpp.

References BIAS::Vector3< T >::GetSkewSymmetricMatrix(), BIAS::HomgPoint2D::Homogenize(), and BIAS::Vector3< T >::NormL2().

Referenced by IntersectConic().

bool Conic2D::IntersectsCircle ( const HomgPoint2D C,
double  Radius 
) const

returns true if the given Conic intersects with the circle of radius Radius around point C, false otherwise

This is a contour line intersection ! Does not test whether circle lies "in" conic or vice versa !

Note
strongly depends upon numerical robustness of SolveQuartic ! You might as well try IntersecConic() to obtain the solutions tested
Examples:
ExampleConic.cpp.

Definition at line 580 of file Conic2D.cpp.

References BIAS::PolynomialSolve::CheckCoefficients(), and BIAS::PolynomialSolve::HasRealSolution().

int BIAS::Matrix3x3< CONIC2D_TYPE >::InvertIP ( )
inherited

In place matrix conversion.

Returns -1 if determinant is zero, 0 on success.

Author
woelk 07/2005
bool Conic2D::IsDoubleLine ( ) const

check whether this conic is a double line

Definition at line 48 of file Conic2D.cpp.

bool Conic2D::IsEllipse ( ) const

check whether this conic is an ellipse

Examples:
ExampleConic.cpp.

Definition at line 93 of file Conic2D.cpp.

bool Conic2D::IsEmpty ( ) const

check whether this conic contains no points

Definition at line 164 of file Conic2D.cpp.

Referenced by IntersectConic().

bool Conic2D::IsHyperbola ( ) const

check whether this conic is a hyperbola

Definition at line 142 of file Conic2D.cpp.

bool BIAS::Matrix3x3< CONIC2D_TYPE >::IsIdentity ( const CONIC2D_TYPE  eps = std::numeric_limits<T>::epsilon()) const
inherited
Author
woelk 12/2007 (c) www.vision-n.de
bool Conic2D::IsParabola ( ) const

check whether this conic is a parabola

Definition at line 121 of file Conic2D.cpp.

bool Conic2D::IsPoint ( ) const

check whether this conic is a point

Definition at line 78 of file Conic2D.cpp.

Referenced by IntersectConic().

bool Conic2D::IsProper ( ) const

is this a proper conic (parabola/hyperbola/ellipse) with rank3 or some of the degenerate cases ?

Definition at line 179 of file Conic2D.cpp.

Referenced by IntersectConic(), and IntersectConicProper().

bool Conic2D::IsSingleLine ( ) const

check whether this conic is a single line

Definition at line 63 of file Conic2D.cpp.

bool BIAS::Matrix3x3< CONIC2D_TYPE >::IsZero ( const CONIC2D_TYPE  eps = std::numeric_limits<T>::epsilon()) const
inherited
Author
woelk 11/2007 (c) www.vision-n.de
bool BIAS::Matrix3x3< CONIC2D_TYPE >::Load ( const std::string &  fname)
inherited
double BIAS::Conic2D::LocatePoint ( const HomgPoint2D point2D) const
inline

determines if the point is inside/on/outside the conic

for "closed" conics, such as ellipses, call this function for a point to determine its position relative to the conic: <0 means: inside the conic >0 means: outside the conic =0 means on the border line

Attention
: make sure that the conic is normalized LocatePoint internally computes the difference of Mahalanobis distances of point2D from the center and a conic point from the center
Examples:
ExampleConic.cpp, and ExampleDrawConic.cpp.

Definition at line 144 of file Conic2D.hh.

Referenced by IntersectConic().

void BIAS::Matrix3x3< CONIC2D_TYPE >::MakeSymmetric ( )
inherited
Author
woelk 11/2007 (c) www.vision-n.de
void BIAS::Matrix3x3< CONIC2D_TYPE >::Mult ( const Vector3< CONIC2D_TYPE > &  argvec,
Vector3< CONIC2D_TYPE > &  destvec 
) const
inlineinherited

matrix - vector multiplicate this matrix with Vector3, storing the result in destvec calculates: destvec = (this Matrix) * argvec

Author
Ingo Thomsen, Jan Woetzel untested (04/17/2002)
void BIAS::Matrix3x3< CONIC2D_TYPE >::Mult ( const Matrix3x3< CONIC2D_TYPE > &  argmat,
Matrix3x3< CONIC2D_TYPE > &  destmat 
) const
inlineinherited

matrix-matrix multiplication with other Matrix3x3, storing the result in destmat calculates: destmat = (this mat) * argmat

Author
Ingo Thomsen, Jan Woetzel untested (04/17/2002)
void BIAS::Matrix3x3< CONIC2D_TYPE >::Mult ( const Matrix3x4< CONIC2D_TYPE > &  argmat,
Matrix3x4< CONIC2D_TYPE > &  destmat 
) const
inherited
Author
woelk 06 2003
long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const
inlineinherited

looks up a debuglevel in the internal map, returns 0 if not found

Author
woelk 09/2006

Definition at line 454 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name)
inlineinherited
bool BIAS::Conic2D::Normalize ( )
inline

sets mean of first 2 diag elements to positive value, so that LocatePoint(x)<0 means x is in conic

Definition at line 149 of file Conic2D.hh.

double BIAS::Matrix3x3< CONIC2D_TYPE >::NormFrobenius ( ) const
inlineinherited
Author
woelk 11/2007 (c) www.vision-n.de
CONIC2D_TYPE BIAS::Matrix3x3< CONIC2D_TYPE >::NormL1 ( ) const
inlineinherited
double BIAS::Matrix3x3< CONIC2D_TYPE >::NormL2 ( ) const
inlineinherited

Definition at line 255 of file Matrix3x3.hh.

bool BIAS::Matrix3x3< CONIC2D_TYPE >::operator!= ( const Matrix3x3< CONIC2D_TYPE > &  arg) const
inlineinherited

Definition at line 274 of file Matrix3x3.hh.

Matrix3x3<CONIC2D_TYPE >& BIAS::Matrix3x3< CONIC2D_TYPE >::operator*= ( const Matrix3x3< CONIC2D_TYPE > &  arg)
inlineinherited

woelk 11/2007 (c) www.vision-n.de

Definition at line 143 of file Matrix3x3.hh.

Matrix3x3<CONIC2D_TYPE >& BIAS::Matrix3x3< CONIC2D_TYPE >::operator*= ( const CONIC2D_TYPE &  arg)
inherited

woelk 11/2007 (c) www.vision-n.de

Matrix3x3<CONIC2D_TYPE >& BIAS::Matrix3x3< CONIC2D_TYPE >::operator+= ( const Matrix3x3< CONIC2D_TYPE > &  arg)
inherited
Author
woelk 11/2007 (c) www.vision-n.de
Matrix3x3<CONIC2D_TYPE >& BIAS::Matrix3x3< CONIC2D_TYPE >::operator-= ( const Matrix3x3< CONIC2D_TYPE > &  arg)
inherited
Author
woelk 11/2007 (c) www.vision-n.de
Matrix3x3<CONIC2D_TYPE >& BIAS::Matrix3x3< CONIC2D_TYPE >::operator/= ( const CONIC2D_TYPE &  arg)
inherited
Author
woelk 11/2007 (c) www.vision-n.de
Conic2D& BIAS::Conic2D::operator= ( const Matrix< CONIC2D_TYPE > &  m)
inline

Definition at line 225 of file Conic2D.hh.

References BIAS::Matrix3x3< T >::operator=().

bool BIAS::Matrix3x3< CONIC2D_TYPE >::operator== ( const Matrix3x3< CONIC2D_TYPE > &  arg) const
inherited
CONIC2D_TYPE * BIAS::Matrix3x3< CONIC2D_TYPE >::operator[] ( const unsigned  row)
inlineinherited
Author
woelk 11/2007 (c) www.vision-n.de

Definition at line 91 of file Matrix3x3.hh.

const CONIC2D_TYPE * BIAS::Matrix3x3< CONIC2D_TYPE >::operator[] ( const unsigned  row) const
inlineinherited
Author
woelk 11/2007 (c) www.vision-n.de

Definition at line 95 of file Matrix3x3.hh.

void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

Definition at line 383 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv)
inlineinherited

Definition at line 369 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 376 of file Debug.hh.

bool BIAS::Matrix3x3< CONIC2D_TYPE >::Save ( const std::string &  fname) const
inherited
void BIAS::Matrix3x3< CONIC2D_TYPE >::Scale ( const CONIC2D_TYPE &  scalar,
Matrix3x3< CONIC2D_TYPE > &  destmat 
) const
inlineinherited

scalar-matrix multiplication

void BIAS::Matrix3x3< CONIC2D_TYPE >::SetAsCrossProductMatrix ( const Vector3< CONIC2D_TYPE > &  vec)
inherited

Sets matrix from vector as cross product matrix of this vector.

void BIAS::Matrix3x3< CONIC2D_TYPE >::SetAsCrossProductMatrix ( const CONIC2D_TYPE &  x,
const CONIC2D_TYPE &  y,
const CONIC2D_TYPE &  z 
)
inherited

Sets matrix from vector as cross product matrix of a vector.

with components (x, y, z)

void BIAS::Matrix3x3< CONIC2D_TYPE >::SetColumn ( const unsigned int  col,
const Vector3< CONIC2D_TYPE > &  c 
)
inherited
Author
woelk 11/2007 (c) www.vision-n.de
void BIAS::Debug::SetDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::SetDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 325 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os)
inlineinherited

Definition at line 398 of file Debug.hh.

void Conic2D::SetEllipse ( const HomgPoint2D Center,
const double &  dAngle,
const double &  radius_a,
const double &  radius_b 
)

construct an ellipse with explicit parameters

Parameters
radius_aradius in (originally) x direction
radius_bradius in (originally) y direction
dAnglerotation angle in radiant (math. positive) center of ellipse
Examples:
ExampleConic.cpp, and ExampleDrawConic.cpp.

Definition at line 299 of file Conic2D.cpp.

References BIAS::Matrix3x3< T >::SetIdentity().

void BIAS::Matrix3x3< CONIC2D_TYPE >::SetFromColumnVectors ( const BIAS::Vector3< CONIC2D_TYPE > &  v0,
const BIAS::Vector3< CONIC2D_TYPE > &  v1,
const BIAS::Vector3< CONIC2D_TYPE > &  v2 
)
inherited

set this matrix from 3 vectors each representating a column

void BIAS::Matrix3x3< CONIC2D_TYPE >::SetFromRowVectors ( const BIAS::Vector3< CONIC2D_TYPE > &  v0,
const BIAS::Vector3< CONIC2D_TYPE > &  v1,
const BIAS::Vector3< CONIC2D_TYPE > &  v2 
)
inherited

set this matrix from 3 vectors, each representating a row

void BIAS::Matrix3x3< CONIC2D_TYPE >::SetFromVector ( const TNT::Vector< CONIC2D_TYPE > &  vec)
inherited

sets the diagonalelements of this 3x3 Matrix rowwise with the values of the 9 (x1) vector

Author
Ingo Thomsen, Jan Woetzel
static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev)
inlinestaticinherited

Definition at line 424 of file Debug.hh.

void BIAS::Matrix3x3< CONIC2D_TYPE >::SetIdentity ( )
inlineinherited

set the elements of this matrix to the identity matrix (possibly overriding the inherited method)

Author
Ingo Thomsen, Jan Woetzel
Date
04/17/2002 untested
void Conic2D::SetPointAndCovariance ( const HomgPoint2D center,
const Matrix2x2< CONIC2D_TYPE > &  cov,
const double &  dScale = GAUSS2D_CONFIDENCE_39_PERCENT 
)

constructs a conic from a point and a covariance matrix

Author
woelk 06/2005

Definition at line 331 of file Conic2D.cpp.

References BIAS::Matrix2x2< T >::Invert(), and BIAS::HomgPoint2D::IsAtInfinity().

void Conic2D::SetQuadricProjection ( const Quadric3D Q,
const PMatrix P,
bool  UseSVD = false 
)

constructs a conic that is a projection of the quadric Q using camera matrix P

Examples:
ExampleConic.cpp.

Definition at line 534 of file Conic2D.cpp.

References BIAS::Quadric3D::GetDualQuadric(), and BIAS::Matrix< T >::Transpose().

void BIAS::Matrix3x3< CONIC2D_TYPE >::SetRow ( const unsigned int  row,
const Vector3< CONIC2D_TYPE > &  r 
)
inherited
Author
woelk 11/2007 (c) www.vision-n.de
void Conic2D::SetSingleLine ( HomgLine2D  theline)

create a degenerate point conic consisting only of one line

Definition at line 1281 of file Conic2D.cpp.

References BIAS::Vector3< T >::NormL2(), and BIAS::Vector3< T >::OuterProduct().

void Conic2D::SetTwoLines ( HomgLine2D  theline1,
HomgLine2D  theline2 
)

create a degenerate point conic consisting of two lines

Definition at line 1288 of file Conic2D.cpp.

References BIAS::Vector3< T >::NormL2(), and BIAS::Vector3< T >::OuterProduct().

void BIAS::Matrix3x3< CONIC2D_TYPE >::SetZero ( )
inlineinherited
Author
woelk 11/2007 (c) www.vision-n.de
void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

prints all internally known debuglevels

Author
woelk 09/2006

Definition at line 496 of file Debug.hh.

CONIC2D_TYPE BIAS::Matrix3x3< CONIC2D_TYPE >::Trace ( ) const
inlineinherited

return the trace of the matrix

Author
woelk 04/2006

Definition at line 230 of file Matrix3x3.hh.

Matrix3x3<CONIC2D_TYPE > BIAS::Matrix3x3< CONIC2D_TYPE >::Transpose ( ) const
inherited

returns transposed matrix tested 12.06.2002

Author
Felix Woelk
void BIAS::Matrix3x3< CONIC2D_TYPE >::Transpose ( const Matrix3x3< CONIC2D_TYPE > &  arg)
inlineinherited

sets this as transposed arg, fw

void BIAS::Matrix3x3< CONIC2D_TYPE >::TransposedMult ( const Vector3< CONIC2D_TYPE > &  argvec,
Vector3< CONIC2D_TYPE > &  destvec 
) const
inlineinherited

multiplies matrix from left with transposed argvec, resulting in transposed destvec

Author
woelk 05/2003
void BIAS::Matrix3x3< CONIC2D_TYPE >::TransposeIP ( )
inlineinherited

tranpose this matrix "in place" example: 0 1 2 –> 0 3 6 3 4 5 –> 1 4 7 6 7 8 –> 2 5 8

Member Data Documentation

long int BIAS::Debug::_liDebugLevel
protectedinherited

Definition at line 510 of file Debug.hh.

Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().

long int BIAS::Debug::_liNextDebugLevel
protectedinherited

new concept, debuglevel are managed here in the debug class

Definition at line 516 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel
protectedinherited

Definition at line 517 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::ostream BIAS::Debug::_zDebugStream
staticprotectedinherited

Definition at line 511 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

CONIC2D_TYPE BIAS::Matrix3x3< CONIC2D_TYPE >::Data_[9]
protectedinherited

Definition at line 282 of file Matrix3x3.hh.

long int BIAS::Debug::GlobalDebugLevel = 0
staticprotectedinherited

Definition at line 513 of file Debug.hh.


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