DGtalTools
1.5.beta
|
#include <imageProcessing/ATu2v0.h>
Public Member Functions | |
BOOST_STATIC_ASSERT ((KSpace::dimension==2)) | |
~ATu2v0 ()=default | |
ATu2v0 (int _verbose=1) | |
void | init (Clone< KSpace > K) |
ATu2v0 (const ATu2v0 &other)=delete | |
ATu2v0 (ATu2v0 &&other)=delete | |
ATu2v0 & | operator= (const ATu2v0 &other)=delete |
ATu2v0 & | operator= (ATu2v0 &&other)=delete |
template<typename Image , typename Function > | |
void | addInput (const Image &image, const Function &f, bool perfect_data=false) |
void | setMetricAverage (bool average) |
void | setUFromInput () |
void | setUFromInputAndMask () |
void | setAlpha (Scalar _alpha) |
void | setAlpha (Scalar _alpha, const PrimalForm2 &m) |
void | setLambda (Scalar _lambda) |
void | setEpsilon (Scalar _epsilon) |
Scalar | computeSNR () const |
Scalar | getAlpha () const |
Scalar | getLambda () const |
Scalar | getEpsilon () const |
const PrimalForm2 & | getG (int i) const |
const PrimalForm2 & | getU (int i) const |
const PrimalForm0 & | getV () const |
unsigned int | size0 () const |
bool | solveU () |
bool | solveV () |
Scalar | computeVariation () |
Scalar | checkV () |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Public Member Functions inherited from DGtal::DECImage2D< TKSpace, EigenLinearAlgebraBackend > | |
BOOST_CONCEPT_ASSERT ((concepts::CCellularGridSpaceND< KSpace >)) | |
BOOST_STATIC_ASSERT ((KSpace::dimension==2)) | |
~DECImage2D ()=default | |
DECImage2D (int _verbose=1) | |
DECImage2D (const DECImage2D &other)=delete | |
DECImage2D (DECImage2D &&other)=delete | |
void | init (Clone< KSpace > aKSpace) |
DECImage2D & | operator= (const DECImage2D &other)=delete |
DECImage2D & | operator= (DECImage2D &&other)=delete |
Protected Attributes | |
std::vector< PrimalForm2 > | g2 |
std::vector< PrimalForm2 > | i2 |
std::vector< PrimalForm2 > | u2 |
PrimalForm0 | v0 |
PrimalForm0 | former_v0 |
double | alpha |
double | lambda |
double | epsilon |
SolverU | solver_u |
SolverV | solver_v |
PrimalIdentity2 | alpha_Id2 |
std::vector< PrimalForm2 > | alpha_g2 |
PrimalIdentity0 | left_V0 |
PrimalForm0 | l_1_over_4 |
PrimalForm0 | l_1_over_4e |
PrimalIdentity0 | l_1_over_4e_Id0 |
bool | metric_average |
Aim: This class solves Ambrosio-Tortorelli functional in a plane for u a (vector of) 2-form(s) and v a 0-form. u is a regularized approximation of an input image data g (grey-level or color image), while v represents the set of discontinuities of u.
Description of template class 'ATu2v0'
TKSpace | any model of CCellularGridSpaceND, e.g KhalimskySpaceND |
TLinearAlgebra | any back-end for performing linear algebra, default is EigenLinearAlgebraBackend. |
typedef DECImage2D<TKSpace, TLinearAlgebra> DGtal::ATu2v0< TKSpace, TLinearAlgebra >::Base |
typedef DiscreteExteriorCalculus<2,2, LinearAlgebra> DGtal::DECImage2D< TKSpace, TLinearAlgebra >::Calculus |
Definition at line 753 of file DECImageHelpers.h.
typedef HyperRectDomain<Space> DGtal::DECImage2D< TKSpace, TLinearAlgebra >::Domain |
Definition at line 752 of file DECImageHelpers.h.
typedef Calculus::DualAntiderivative1 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::DualAntiderivative1 |
Definition at line 768 of file DECImageHelpers.h.
typedef Calculus::DualAntiderivative2 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::DualAntiderivative2 |
Definition at line 769 of file DECImageHelpers.h.
typedef Calculus::DualDerivative0 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::DualDerivative0 |
Definition at line 764 of file DECImageHelpers.h.
typedef Calculus::DualDerivative1 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::DualDerivative1 |
Definition at line 765 of file DECImageHelpers.h.
typedef Calculus::DualHodge0 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::DualHodge0 |
Definition at line 773 of file DECImageHelpers.h.
typedef Calculus::DualHodge1 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::DualHodge1 |
Definition at line 774 of file DECImageHelpers.h.
typedef Calculus::DualHodge2 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::DualHodge2 |
Definition at line 775 of file DECImageHelpers.h.
typedef Calculus::Index DGtal::DECImage2D< TKSpace, TLinearAlgebra >::Index |
Definition at line 755 of file DECImageHelpers.h.
typedef TKSpace DGtal::ATu2v0< TKSpace, TLinearAlgebra >::KSpace |
typedef TLinearAlgebra DGtal::ATu2v0< TKSpace, TLinearAlgebra >::LinearAlgebra |
typedef LinearAlgebra::SolverSimplicialLLT DGtal::ATu2v0< TKSpace, TLinearAlgebra >::LinearAlgebraSolver |
typedef Space::Point DGtal::DECImage2D< TKSpace, TLinearAlgebra >::Point |
Definition at line 746 of file DECImageHelpers.h.
typedef Calculus::PrimalAntiderivative1 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::PrimalAntiderivative1 |
Definition at line 766 of file DECImageHelpers.h.
typedef Calculus::PrimalAntiderivative2 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::PrimalAntiderivative2 |
Definition at line 767 of file DECImageHelpers.h.
typedef Calculus::PrimalDerivative0 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::PrimalDerivative0 |
Definition at line 762 of file DECImageHelpers.h.
typedef Calculus::PrimalDerivative1 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::PrimalDerivative1 |
Definition at line 763 of file DECImageHelpers.h.
typedef Calculus::PrimalForm0 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::PrimalForm0 |
Definition at line 756 of file DECImageHelpers.h.
typedef Calculus::PrimalForm1 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::PrimalForm1 |
Definition at line 757 of file DECImageHelpers.h.
typedef Calculus::PrimalForm2 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::PrimalForm2 |
Definition at line 758 of file DECImageHelpers.h.
typedef Calculus::PrimalHodge0 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::PrimalHodge0 |
Definition at line 770 of file DECImageHelpers.h.
typedef Calculus::PrimalHodge1 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::PrimalHodge1 |
Definition at line 771 of file DECImageHelpers.h.
typedef Calculus::PrimalHodge2 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::PrimalHodge2 |
Definition at line 772 of file DECImageHelpers.h.
typedef Calculus::PrimalIdentity0 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::PrimalIdentity0 |
Definition at line 759 of file DECImageHelpers.h.
typedef Calculus::PrimalIdentity1 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::PrimalIdentity1 |
Definition at line 760 of file DECImageHelpers.h.
typedef Calculus::PrimalIdentity2 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::PrimalIdentity2 |
Definition at line 761 of file DECImageHelpers.h.
typedef Space::RealVector DGtal::DECImage2D< TKSpace, TLinearAlgebra >::RealVector |
Definition at line 747 of file DECImageHelpers.h.
typedef RealVector::Component DGtal::DECImage2D< TKSpace, TLinearAlgebra >::Scalar |
Definition at line 748 of file DECImageHelpers.h.
typedef KSpace::SCell DGtal::DECImage2D< TKSpace, TLinearAlgebra >::SCell |
Definition at line 749 of file DECImageHelpers.h.
typedef DiscreteExteriorCalculusSolver<Calculus, LinearAlgebraSolver, 2, PRIMAL, 2, PRIMAL> DGtal::ATu2v0< TKSpace, TLinearAlgebra >::SolverU |
typedef DiscreteExteriorCalculusSolver<Calculus, LinearAlgebraSolver, 0, PRIMAL, 0, PRIMAL> DGtal::ATu2v0< TKSpace, TLinearAlgebra >::SolverV |
typedef KSpace::Space DGtal::DECImage2D< TKSpace, TLinearAlgebra >::Space |
Definition at line 745 of file DECImageHelpers.h.
|
default |
Destructor.
DGtal::ATu2v0< TKSpace, TLinearAlgebra >::ATu2v0 | ( | int | _verbose = 1 | ) |
Default constructor. The object needs to be initialized with init.
_verbose | specifies the verbose level (0: silent, 1: more info ... ). |
|
delete |
Copy constructor.
other | the object to clone. |
|
delete |
Move constructor.
other | the object to move. |
void DGtal::ATu2v0< TKSpace, TLinearAlgebra >::addInput | ( | const Image & | image, |
const Function & | f, | ||
bool | perfect_data = false |
||
) |
Adds an input 2-form by filtering an image values.
image | any image such that the domain of this space is included in the domain of the image. |
f | any functor associated a scalar to an image value. |
perfect_data | when 'false', this is normal input data, otherwise this is perfect data only used for SNR computation. |
unsigned char
, should be called asColor
, should be called as Image | any Image type. |
Function | any function type ( typename Image::Value ) -> Scalar. |
DGtal::ATu2v0< TKSpace, TLinearAlgebra >::BOOST_STATIC_ASSERT | ( | (KSpace::dimension==2) | ) |
Scalar DGtal::ATu2v0< TKSpace, TLinearAlgebra >::checkV | ( | ) |
Checks that form v is between 0 and 1 and forces v to be in-between.
Scalar DGtal::ATu2v0< TKSpace, TLinearAlgebra >::computeSNR | ( | ) | const |
Computes the SNR of u wrt ideal input (should have been given.
Scalar DGtal::ATu2v0< TKSpace, TLinearAlgebra >::computeVariation | ( | ) |
Computes the variation of v after a call to solveV.
|
inline |
Definition at line 276 of file ATu2v0.h.
References DGtal::ATu2v0< TKSpace, TLinearAlgebra >::alpha.
|
inline |
Definition at line 282 of file ATu2v0.h.
References DGtal::ATu2v0< TKSpace, TLinearAlgebra >::epsilon.
|
inline |
i | an integer (between 0 and the number of input forms). |
Definition at line 286 of file ATu2v0.h.
References DGtal::ATu2v0< TKSpace, TLinearAlgebra >::g2.
|
inline |
Definition at line 279 of file ATu2v0.h.
References DGtal::ATu2v0< TKSpace, TLinearAlgebra >::lambda.
|
inline |
i | an integer (between 0 and the number of input forms). |
Definition at line 290 of file ATu2v0.h.
References DGtal::ATu2v0< TKSpace, TLinearAlgebra >::u2.
|
inline |
Definition at line 293 of file ATu2v0.h.
References DGtal::ATu2v0< TKSpace, TLinearAlgebra >::v0.
void DGtal::ATu2v0< TKSpace, TLinearAlgebra >::init | ( | Clone< KSpace > | K | ) |
Constructor from Khalimsky space, which specifies the domain of calculus.
bool DGtal::ATu2v0< TKSpace, TLinearAlgebra >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
|
delete |
Move assignment operator.
other | the object to move. |
|
delete |
Copy assignment operator.
other | the object to copy. |
void DGtal::ATu2v0< TKSpace, TLinearAlgebra >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
void DGtal::ATu2v0< TKSpace, TLinearAlgebra >::setAlpha | ( | Scalar | _alpha | ) |
Sets the parameter \( alpha \) as global to the image. Should be set before setLambda and setEpsilon.
_alpha | the \( \alpha \) parameter in AT functional ( in term \( \int \alpha | u - g |^2 \) ). Dimension theory tells that it is in 1/area unit, the lower the smoother will be the output. |
void DGtal::ATu2v0< TKSpace, TLinearAlgebra >::setAlpha | ( | Scalar | _alpha, |
const PrimalForm2 & | m | ||
) |
Sets the parameter \( alpha \) of the image, as well as a weight for each input data as the primal 0-form m. Should be set before setLambda and setEpsilon.
_alpha | the \( \alpha \) parameter in AT functional ( in term \( \int \alpha | u - g |^2 \) ). Dimension theory tells that it is in 1/area unit, the lower the smoother will be the output. |
m | a 0-form that specifies which input data is significant (1) or not be used (0). |
void DGtal::ATu2v0< TKSpace, TLinearAlgebra >::setEpsilon | ( | Scalar | _epsilon | ) |
Sets the parameter \( \epsilon \) of AT functional. Should be set after setAlpha and setLambda.
_epsilon | the \( \epsilon \) parameter in AT functional ( in terms \( \int \lambda \epsilon | v \grad u |^2 + \int \frac{\lambda}{4\epsilon} |1-v|^2 \) ). Dimension theory tells that it is in length unit, the lower the thinner is the set of discontinuities. |
void DGtal::ATu2v0< TKSpace, TLinearAlgebra >::setLambda | ( | Scalar | _lambda | ) |
Sets the parameter \( \lambda \) of AT functional. Should be set after setAlpha and before setEpsilon.
_lambda | the \( \lambda \) parameter in AT functional ( in terms \( \int \lambda \epsilon | v \grad u |^2 + \int \frac{\lambda}{4\epsilon} |1-v|^2 \) ). Dimension theory tells that it is in 1/length unit, the lower the longer is the set of discontinuities. |
void DGtal::ATu2v0< TKSpace, TLinearAlgebra >::setMetricAverage | ( | bool | average | ) |
Use metric average to smooth L1-metric effects.
void DGtal::ATu2v0< TKSpace, TLinearAlgebra >::setUFromInput | ( | ) |
Sets approximation u to be equal to the input. Used for initializating u. Should be called once all addInput have been called.
void DGtal::ATu2v0< TKSpace, TLinearAlgebra >::setUFromInputAndMask | ( | ) |
Sets approximation u to be equal to the input. Used for initializating u. Should be called once all addInput have been called. Note that it initializes u with random values wherever an inpainting mask was applied.
|
inline |
Definition at line 296 of file ATu2v0.h.
References DGtal::KForm< TCalculus, order, duality >::myContainer, and DGtal::ATu2v0< TKSpace, TLinearAlgebra >::v0.
bool DGtal::ATu2v0< TKSpace, TLinearAlgebra >::solveU | ( | ) |
Computes a solution to function(s) u given the input g and current v.
bool DGtal::ATu2v0< TKSpace, TLinearAlgebra >::solveV | ( | ) |
Computes a solution to function v given the input g and current u.
|
protected |
Smoothness parameter alpha of AT (in 1/area unit)
Definition at line 369 of file ATu2v0.h.
Referenced by DGtal::ATu2v0< TKSpace, TLinearAlgebra >::getAlpha().
|
protected |
|
protected |
Calculus DGtal::DECImage2D< TKSpace, TLinearAlgebra >::calculus |
The discrete exterior calculus instance.
Definition at line 884 of file DECImageHelpers.h.
PrimalDerivative0 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::D0 |
primal derivative: 0-form -> 1-form
Definition at line 890 of file DECImageHelpers.h.
PrimalDerivative1 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::D1 |
primal derivative: 1-form -> 2-form
Definition at line 892 of file DECImageHelpers.h.
Scalar DGtal::ATu2v0< TKSpace, TLinearAlgebra >::delta_v_l1 |
Scalar DGtal::ATu2v0< TKSpace, TLinearAlgebra >::delta_v_l2 |
Scalar DGtal::ATu2v0< TKSpace, TLinearAlgebra >::delta_v_loo |
DualDerivative0 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::dual_D0 |
dual derivative dual 0-form -> dual 1-form
Definition at line 894 of file DECImageHelpers.h.
DualDerivative1 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::dual_D1 |
dual derivative dual 1-form -> dual 2-form
Definition at line 896 of file DECImageHelpers.h.
DualHodge0 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::dual_h0 |
hodge star: dual 0-form -> 0-form
Definition at line 904 of file DECImageHelpers.h.
DualHodge1 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::dual_h1 |
hodge star: dual 1-form -> 1-form
Definition at line 906 of file DECImageHelpers.h.
DualHodge2 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::dual_h2 |
hodge star: dual 2-form -> 2-form
Definition at line 908 of file DECImageHelpers.h.
|
protected |
Thickness of discontinuity set (in length unit).
Definition at line 373 of file ATu2v0.h.
Referenced by DGtal::ATu2v0< TKSpace, TLinearAlgebra >::getEpsilon().
|
protected |
|
protected |
The g 2-forms.
Definition at line 359 of file ATu2v0.h.
Referenced by DGtal::ATu2v0< TKSpace, TLinearAlgebra >::getG().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Amount of discontinuity parameter lambda (in 1/length unit).
Definition at line 371 of file ATu2v0.h.
Referenced by DGtal::ATu2v0< TKSpace, TLinearAlgebra >::getLambda().
|
protected |
PrimalDerivative0 DGtal::ATu2v0< TKSpace, TLinearAlgebra >::M01 |
PrimalDerivative1 DGtal::ATu2v0< TKSpace, TLinearAlgebra >::M12 |
|
protected |
PrimalAntiderivative2 DGtal::ATu2v0< TKSpace, TLinearAlgebra >::primal_AD2 |
PrimalHodge0 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::primal_h0 |
hodge star: 0-form -> dual 0-form
Definition at line 898 of file DECImageHelpers.h.
PrimalHodge1 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::primal_h1 |
hodge star: 1-form -> dual 1-form
Definition at line 900 of file DECImageHelpers.h.
PrimalHodge2 DGtal::DECImage2D< TKSpace, TLinearAlgebra >::primal_h2 |
hodge star: 2-form -> dual 2-form
Definition at line 902 of file DECImageHelpers.h.
|
protected |
|
protected |
|
protected |
The u 2-forms.
Definition at line 363 of file ATu2v0.h.
Referenced by DGtal::ATu2v0< TKSpace, TLinearAlgebra >::getU().
|
protected |
The v 0-form.
Definition at line 365 of file ATu2v0.h.
Referenced by DGtal::ATu2v0< TKSpace, TLinearAlgebra >::getV(), and DGtal::ATu2v0< TKSpace, TLinearAlgebra >::size0().
int DGtal::DECImage2D< TKSpace, TLinearAlgebra >::verbose |
The verbose level (0: silent).
Definition at line 882 of file DECImageHelpers.h.