DGtal 1.4.0
|
Aim: This class represents a 2D contour convolved by some binomial. It computes first and second order derivatives so as to be able to estimate tangent and curvature. In particular, it smoothes digital contours but could be used for other kind of contours. More...
#include <DGtal/geometry/curves/BinomialConvolver.h>
Public Types | |
typedef TValue | Value |
typedef TConstIteratorOnPoints | ConstIteratorOnPoints |
typedef ConstIteratorOnPoints::value_type | Point |
Public Member Functions | |
BinomialConvolver (unsigned int n=1) | |
~BinomialConvolver () | |
void | setSize (unsigned int n) |
unsigned int | size () const |
void | init (const double h, const ConstIteratorOnPoints &itb, const ConstIteratorOnPoints &ite, const bool isClosed) |
int | index (const ConstIteratorOnPoints &it) const |
std::pair< Value, Value > | x (int i) const |
std::pair< Value, Value > | dx (int i) const |
std::pair< Value, Value > | d2x (int i) const |
std::pair< Value, Value > | tangent (int i) const |
Value | curvature (int i) const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Static Public Member Functions | |
static unsigned int | suggestedSize (const double h, const ConstIteratorOnPoints &itb, const ConstIteratorOnPoints &ite) |
Protected Attributes | |
unsigned int | myN |
double | myH |
Signal< Value > | myX |
Signal< Value > | myY |
Signal< Value > | myDX |
Signal< Value > | myDY |
Signal< Value > | myDDX |
Signal< Value > | myDDY |
ConstIteratorOnPoints | myBegin |
Copy of the begin iterator. | |
ConstIteratorOnPoints | myEnd |
Copy of the end iterator. | |
std::map< ConstIteratorOnPoints, int > | myMapIt2Idx |
Private Member Functions | |
BinomialConvolver (const BinomialConvolver &other) | |
BinomialConvolver & | operator= (const BinomialConvolver &other) |
Aim: This class represents a 2D contour convolved by some binomial. It computes first and second order derivatives so as to be able to estimate tangent and curvature. In particular, it smoothes digital contours but could be used for other kind of contours.
Description of template class 'BinomialConvolver'.
TConstIteratorOnPoints | the type that represents an iterator in a sequence of points. Each component of Point must be convertible into a double. |
TValue | the type for storing the convolved versions of the contour (double as default). |
Definition at line 73 of file BinomialConvolver.h.
typedef TConstIteratorOnPoints DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::ConstIteratorOnPoints |
Definition at line 78 of file BinomialConvolver.h.
typedef ConstIteratorOnPoints::value_type DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::Point |
Definition at line 79 of file BinomialConvolver.h.
typedef TValue DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::Value |
Definition at line 77 of file BinomialConvolver.h.
DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::BinomialConvolver | ( | unsigned int | n = 1 | ) |
Constructor. The object is not valid.
n | the parameter for the size of the binomial kernel (which is then 2^n). |
DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::~BinomialConvolver | ( | ) |
Destructor.
|
private |
Copy constructor.
other | the object to clone. Forbidden by default. |
Value DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::curvature | ( | int | i | ) | const |
i | any index. |
NB: depends on the gridstep.
std::pair< Value, Value > DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::d2x | ( | int | i | ) | const |
i | any index. |
std::pair< Value, Value > DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::dx | ( | int | i | ) | const |
i | any index. |
int DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::index | ( | const ConstIteratorOnPoints & | it | ) | const |
Given a valid iterator [it], return the corresponding index position in the binomial convolver in logarithmic time. The method init should have been called before.
it | any valid iterator |
void DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::init | ( | const double | h, |
const ConstIteratorOnPoints & | itb, | ||
const ConstIteratorOnPoints & | ite, | ||
const bool | isClosed ) |
Initializes the convolver with some sequence of points.
h | grid size (must be >0). |
itb | begin iterator |
ite | end iterator |
isClosed | true if the input range is viewed as closed. |
The object is then valid.
bool DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
|
private |
Assignment.
other | the object to copy. |
void DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
void DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::setSize | ( | unsigned int | n | ) |
n | the parameter for the size of the binomial kernel (which is then 2^n). |
unsigned int DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::size | ( | ) | const |
|
static |
std::pair< Value, Value > DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::tangent | ( | int | i | ) | const |
i | any index. |
std::pair< Value, Value > DGtal::BinomialConvolver< TConstIteratorOnPoints, TValue >::x | ( | int | i | ) | const |
i | any index. |
|
protected |
Copy of the begin iterator.
Definition at line 213 of file BinomialConvolver.h.
|
protected |
Definition at line 209 of file BinomialConvolver.h.
|
protected |
Definition at line 210 of file BinomialConvolver.h.
|
protected |
Definition at line 207 of file BinomialConvolver.h.
|
protected |
Definition at line 208 of file BinomialConvolver.h.
|
protected |
Copy of the end iterator.
Definition at line 216 of file BinomialConvolver.h.
|
protected |
Definition at line 204 of file BinomialConvolver.h.
|
protected |
Definition at line 219 of file BinomialConvolver.h.
|
protected |
Definition at line 203 of file BinomialConvolver.h.
|
protected |
Definition at line 205 of file BinomialConvolver.h.
|
protected |
Definition at line 206 of file BinomialConvolver.h.