DGtal
1.5.beta
|
Aim: This class implements different methods used to define the meaningful scale analysis as proposed in [67] . In particular, it uses the Profile class to represent a multi-scale profile and to compute a meaningful scale. It also permits to get a noise estimation from the given profile. More...
#include <DGtal/math/MeaningfulScaleAnalysis.h>
Public Types | |
typedef TProfile | Profile |
Public Member Functions | |
MeaningfulScaleAnalysis (ConstAlias< Profile > aProfile) | |
~MeaningfulScaleAnalysis () | |
void | computeMeaningfulScales (std::vector< std::pair< unsigned int, unsigned int > > &intervals, const unsigned int minSize=1, const double maxSlope=-0.2, const double minSlope=-1e10) const |
std::pair< bool, double > | getSlopeFromMeaningfulScales (const double maxSlope=-0.2, const double minSlope=-1e10, const unsigned int minSize=2) const |
unsigned int | noiseLevel (const unsigned int minSize=1, const double maxSlope=-0.2, const double minSlope=-1e10) const |
unsigned int | lowerBoundedNoiseLevel (const unsigned int minSize=1, const double maxSlope=-0.2, const double minSlope=-1e10, const double lowerBoundAtScale1=1.0, const double lowerBoundSlope=-2.0) const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Protected Member Functions | |
MeaningfulScaleAnalysis () | |
Protected Attributes | |
const Profile & | myProfile |
Private Member Functions | |
MeaningfulScaleAnalysis (const MeaningfulScaleAnalysis &other) | |
MeaningfulScaleAnalysis & | operator= (const MeaningfulScaleAnalysis &other) |
Aim: This class implements different methods used to define the meaningful scale analysis as proposed in [67] . In particular, it uses the Profile class to represent a multi-scale profile and to compute a meaningful scale. It also permits to get a noise estimation from the given profile.
Description of class 'MeaningfulScaleAnalysis'
A typical example is for instance the length of maximal segments obtained at different scales.
First we construct a Profile:
Then, we can add values to the profile:
Finally we can construct the MeaningfulScaleAnalysis object and obtain the meaningful scale:
TProfile | the type of the profile class. |
Definition at line 112 of file MeaningfulScaleAnalysis.h.
typedef TProfile DGtal::MeaningfulScaleAnalysis< TProfile >::Profile |
Definition at line 117 of file MeaningfulScaleAnalysis.h.
DGtal::MeaningfulScaleAnalysis< TProfile >::MeaningfulScaleAnalysis | ( | ConstAlias< Profile > | aProfile | ) |
Constructor
DGtal::MeaningfulScaleAnalysis< TProfile >::~MeaningfulScaleAnalysis | ( | ) |
Destructor.
|
protected |
Constructor. Forbidden by default (protected to avoid g++ warnings).
|
private |
Copy constructor.
other | the object to clone. Forbidden by default. |
void DGtal::MeaningfulScaleAnalysis< TProfile >::computeMeaningfulScales | ( | std::vector< std::pair< unsigned int, unsigned int > > & | intervals, |
const unsigned int | minSize = 1 , |
||
const double | maxSlope = -0.2 , |
||
const double | minSlope = -1e10 |
||
) | const |
A meaningful scale is an interval of scales of length no smaller than [min_width] and in which the profile has slopes below [max_slope] and above [min_slope]. This method computes the sequence of meaningful scales for surfel [idx].
[out] | intervals | (returns) a list of meaningful scales. |
[in] | minSize | the minimum length for the meaningful scales. |
[in] | maxSlope | the maximum allowed slope for length evolution. |
[in] | minSlope | the minimum allowed slope for length evolution. |
Referenced by TEST_CASE().
std::pair<bool, double> DGtal::MeaningfulScaleAnalysis< TProfile >::getSlopeFromMeaningfulScales | ( | const double | maxSlope = -0.2 , |
const double | minSlope = -1e10 , |
||
const unsigned int | minSize = 2 |
||
) | const |
Compute the profile slope of the first meaningful scale interval computed by a simple linear regression model.
[in] | maxSlope | the maximum allowed slope for length evolution. |
[in] | minSlope | the minimum allowed slope for length evolution. |
[in] | minSize | the minimum length for the meaningful scales. |
Referenced by TEST_CASE().
bool DGtal::MeaningfulScaleAnalysis< TProfile >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
unsigned int DGtal::MeaningfulScaleAnalysis< TProfile >::lowerBoundedNoiseLevel | ( | const unsigned int | minSize = 1 , |
const double | maxSlope = -0.2 , |
||
const double | minSlope = -1e10 , |
||
const double | lowerBoundAtScale1 = 1.0 , |
||
const double | lowerBoundSlope = -2.0 |
||
) | const |
The noise level is the first scale of the first meaningful scale. A meaningful scale is an interval of scales of length no smaller than [minWidth] and in which the profile has slopes below [maxSlope]. The lower bounded noise level also requires minimum lenghs for different scales. Therefore the profile must be greater that [lower_bound_at_scale_1]+[lower_bound_slope]*scale.
[in] | minSize | the minimum length for the meaningful scales. |
[in] | maxSlope | the maximum allowed slope for length evolution. |
[in] | minSlope | the minimum allowed slope for length evolution. |
[in] | lowerBoundAtScale1 | the lower bound for the profile at scale 1. |
[in] | lowerBoundSlope | the slope of the lower bound for the profile (for instance -1 for digital contours, -3 for digital image graphs since area values are divided by (scale)^3. |
Referenced by TEST_CASE().
unsigned int DGtal::MeaningfulScaleAnalysis< TProfile >::noiseLevel | ( | const unsigned int | minSize = 1 , |
const double | maxSlope = -0.2 , |
||
const double | minSlope = -1e10 |
||
) | const |
The noise level is the first scale of the first meaningful scale. A meaningful scale is an interval of scales of length no smaller than [min_width] and in which the profile has slopes below [max_slope].
[in] | minSize | the minimum length for the meaningful scales. |
[in] | maxSlope | the maximum allowed slope for length evolution. |
[in] | minSlope | the minimum allowed slope for length evolution. |
Referenced by TEST_CASE().
|
private |
Assignment.
other | the object to copy. |
void DGtal::MeaningfulScaleAnalysis< TProfile >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
|
protected |
Definition at line 234 of file MeaningfulScaleAnalysis.h.