DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::MeasureOfStraightLines Class Reference

The aim of this class is to compute the measure in the Lebesgues sense of the set of straight lines associated to domains defined as polygons in the (a,b)-parameter space. This parameter space maps the line $ax-y+b=0$ to the point $(a,b)$. More...

#include <DGtal/math/MeasureOfStraightLines.h>

Public Member Functions

 MeasureOfStraightLines ()
 
 ~MeasureOfStraightLines ()
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 
double computeMeasure (const std::vector< double > &a, const std::vector< double > &b)
 
double computeCentroidA (const std::vector< double > &a, const std::vector< double > &b)
 
double computeCentroidB (const std::vector< double > &a, const std::vector< double > &b)
 
void setEpsilon (const double aValue)
 

Private Member Functions

 MeasureOfStraightLines (const MeasureOfStraightLines &other)
 
MeasureOfStraightLinesoperator= (const MeasureOfStraightLines &other)
 
double computeMeasureEdge (double a0, double b0, double a1, double b1)
 
double computeCentroidEdge_a (double a0, double b0, double a1, double b1)
 
double computeCentroidEdge_b (double a0, double b0, double a1, double b1)
 
double __computeCentroidTriApprox_b (double a0, double b0, double a1, double b1)
 
double __computeCentroidEdgeApprox_b (double a0, double b0, double a1, double b1)
 
double __computeCentroidSquare_b (double x1, double y1, double x2, double y2)
 
int sign (const double a)
 

Private Attributes

double myEpsilon
 

Detailed Description

The aim of this class is to compute the measure in the Lebesgues sense of the set of straight lines associated to domains defined as polygons in the (a,b)-parameter space. This parameter space maps the line $ax-y+b=0$ to the point $(a,b)$.

Description of class 'MeasureOfStraightLines'

Aim:

* @inproceedings{COEURJOLLY:2009:HAL-00432711:1,
*   title = { {M}easure of {S}traight {L}ines and its {A}pplications in {D}igital {G}eometry},
*   author = {{C}oeurjolly, {D}avid and {S}ivignon, {I}sabelle},
*   booktitle = {13th {I}nternational {W}orkshop on {C}ombinatorial {I}mage {A}nalysis 13th {I}nternational {W}orkshop on {C}ombinatorial {I}mage {A}nalysis },
*   publisher = {{R}esearch {P}ublishing {S}ervices },
*   pages = {1-12 },
*   address = {{C}ancun {M}exique },
*   audience = {internationale },
*   year = {2009},
*   URL = {http://hal.archives-ouvertes.fr/hal-00432711/PDF/mesure.pdf},
* }
* 
See also
testMeasure.cpp
Todo
Create a vector<Point> interface

Definition at line 79 of file MeasureOfStraightLines.h.

Constructor & Destructor Documentation

◆ MeasureOfStraightLines() [1/2]

DGtal::MeasureOfStraightLines::MeasureOfStraightLines ( )

Constructor.

◆ ~MeasureOfStraightLines()

DGtal::MeasureOfStraightLines::~MeasureOfStraightLines ( )

Destructor.

◆ MeasureOfStraightLines() [2/2]

DGtal::MeasureOfStraightLines::MeasureOfStraightLines ( const MeasureOfStraightLines & other)
private

Copy constructor.

Parameters
otherthe object to clone. Forbidden by default.

Member Function Documentation

◆ __computeCentroidEdgeApprox_b()

double DGtal::MeasureOfStraightLines::__computeCentroidEdgeApprox_b ( double a0,
double b0,
double a1,
double b1 )
private

Approximate the centroid on 'b' on the trapezioid (a0,0)-(a0,b0)-(a1,b1)-(a1,0) (internal function)

Parameters
a0abscissa first point.
b0ordinate of the first point.
a1abscissa of the second point.
b1ordinate of the second point.

◆ __computeCentroidSquare_b()

double DGtal::MeasureOfStraightLines::__computeCentroidSquare_b ( double x1,
double y1,
double x2,
double y2 )
private

Compute the centroid on 'b' on the rectangular domain with vertices (x1,,y1) - (x2,y2)

Precondition
y1<y2
Parameters
x1abscissa first point.
y1ordinate of the first point.
x2abscissa of the second point.
y2ordinate of the second point.

◆ __computeCentroidTriApprox_b()

double DGtal::MeasureOfStraightLines::__computeCentroidTriApprox_b ( double a0,
double b0,
double a1,
double b1 )
private

Approximate the centroid on 'b' on the triangle (0,0)-(a0,b0)-(a1,b1) (internal function)

Parameters
a0abscissa first point.
b0ordinate of the first point.
a1abscissa of the second point.
b1ordinate of the second point.

◆ computeCentroidA()

double DGtal::MeasureOfStraightLines::computeCentroidA ( const std::vector< double > & a,
const std::vector< double > & b )

Compute the abscissa of the centroid of the polygon {(a_i,b_i)} in the (a,b)-parameter space with respect to the measure of lines.

REQUIREMENTS:

  • The polygon is given counter-clockwise
  • a_i > 0
Parameters
athe a-value of polygon vertices
bthe b-value of polygon vertices
Returns
the measure value (positive value)

Referenced by testUnitSquareCentroid().

◆ computeCentroidB()

double DGtal::MeasureOfStraightLines::computeCentroidB ( const std::vector< double > & a,
const std::vector< double > & b )

Compute the ordinate of the centroid of the polygon {(a_i,b_i)} in the (a,b)-parameter space with respect to the measure of lines. Note that there is a numerical approximation is performed.

REQUIREMENTS:

  • The polygon is given counter-clockwise
  • a_i > 0
Parameters
athe a-value of polygon vertices
bthe b-value of polygon vertices
Returns
the measure value (positive value)

Referenced by testUnitSquareCentroid().

◆ computeCentroidEdge_a()

double DGtal::MeasureOfStraightLines::computeCentroidEdge_a ( double a0,
double b0,
double a1,
double b1 )
private

Compute the abscissa of the centroid associated to an edge (a0,b0)-(a1,b1) It returns the measure of the triangle defined by the origin and the edge.

Parameters
a0abscissa first point.
b0ordinate of the first point.
a1abscissa of the second point.
b1ordinate of the second point.
Returns
the measure

◆ computeCentroidEdge_b()

double DGtal::MeasureOfStraightLines::computeCentroidEdge_b ( double a0,
double b0,
double a1,
double b1 )
private

Compute the ordinate of the centroid associated to an edge (a0,b0)-(a1,b1) It returns the measure of the triangle defined by the origin and the edge.

Parameters
a0abscissa first point.
b0ordinate of the first point.
a1abscissa of the second point.
b1ordinate of the second point.
Returns
the measure

◆ computeMeasure()

double DGtal::MeasureOfStraightLines::computeMeasure ( const std::vector< double > & a,
const std::vector< double > & b )

Compute the measure of the polygon {(a_i,b_i)} in the (a,b)-parameter space

REQUIREMENTS:

  • The polygon is given counter-clockwise
  • a_i > 0
Parameters
athe a-value of polygon vertices
bthe b-value of polygon vertices
Returns
the measure value (positive value)

Referenced by testUnitSquare().

◆ computeMeasureEdge()

double DGtal::MeasureOfStraightLines::computeMeasureEdge ( double a0,
double b0,
double a1,
double b1 )
private

Compute the measure associated to an edge (a0,b0)-(a1,b1) It returns the measure of the triangle defined by the origin and the edge.

Parameters
a0abscissa first point.
b0ordinate of the first point.
a1abscissa of the second point.
b1ordinate of the second point.
Returns
the measure

◆ isValid()

bool DGtal::MeasureOfStraightLines::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ operator=()

MeasureOfStraightLines & DGtal::MeasureOfStraightLines::operator= ( const MeasureOfStraightLines & other)
private

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.

◆ selfDisplay()

void DGtal::MeasureOfStraightLines::selfDisplay ( std::ostream & out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ setEpsilon()

void DGtal::MeasureOfStraightLines::setEpsilon ( const double aValue)

Set the internal Epsilon threshold for the numerical approximation.

Parameters
aValuethe new epsilon value

◆ sign()

int DGtal::MeasureOfStraightLines::sign ( const double a)
private
Parameters
aa value
Returns
the sign of a number (1 or -1)

Field Documentation

◆ myEpsilon

double DGtal::MeasureOfStraightLines::myEpsilon
private

Definition at line 171 of file MeasureOfStraightLines.h.


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