33 #if defined(ATu2v0_RECURSES)
34 #error Recursive header files inclusion detected in ATu2v0.h
37 #define ATu2v0_RECURSES
47 #include "DGtal/math/linalg/EigenSupport.h"
48 #include "DGtal/base/Common.h"
49 #include "DGtal/dec/DiscreteExteriorCalculus.h"
50 #include "DGtal/dec/DiscreteExteriorCalculusSolver.h"
51 #include "DGtal/dec/DiscreteExteriorCalculusFactory.h"
52 #include "DECImageHelpers.h"
72 template <
typename TKSpace,
73 typename TLinearAlgebra = EigenLinearAlgebraBackend >
201 template <
typename Image,
typename Function>
204 bool perfect_data =
false );
359 std::vector< PrimalForm2 >
g2;
361 std::vector< PrimalForm2 >
i2;
363 std::vector< PrimalForm2 >
u2;
414 template <
typename TKSpace,
typename TLinearAlgebra>
431 #undef ATu2v0_RECURSES
static const constexpr Dimension dimension
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
Aim: This class solves Ambrosio-Tortorelli functional in a plane for u a (vector of) 2-form(s) and v ...
std::vector< PrimalForm2 > i2
The ideal input 2-forms (for snr computation).
PrimalForm0 l_1_over_4e
lambda 1/(4*epsilon) 1
SolverV solver_v
The solver for 0-form v.
double epsilon
Thickness of discontinuity set (in length unit).
Scalar computeSNR() const
Computes the SNR of u wrt ideal input (should have been given.
bool metric_average
When 'true', use metric average, otherwise use identity.
Scalar computeVariation()
ATu2v0(const ATu2v0 &other)=delete
void setEpsilon(Scalar _epsilon)
void addInput(const Image &image, const Function &f, bool perfect_data=false)
Scalar delta_v_l2
The L2-norm of variation of v.
double lambda
Amount of discontinuity parameter lambda (in 1/length unit).
PrimalIdentity0 l_1_over_4e_Id0
lambda 1/(4_epsilon) Id0
void selfDisplay(std::ostream &out) const
PrimalAntiderivative2 primal_AD2
Antiderivative 2-form -> to 1-form.
Scalar delta_v_loo
The Linfinity-norm of variation of v.
void init(Clone< KSpace > K)
BOOST_STATIC_ASSERT((KSpace::dimension==2))
TLinearAlgebra LinearAlgebra
RealVector::Component Scalar
ATu2v0(ATu2v0 &&other)=delete
std::vector< PrimalForm2 > u2
The u 2-forms.
SolverU solver_u
The solver for every 2-form u[i].
PrimalForm0 v0
The v 0-form.
PrimalForm0 former_v0
The v 0-form at the previous iteration.
LinearAlgebra::SolverSimplicialLLT LinearAlgebraSolver
void setUFromInputAndMask()
PrimalIdentity0 left_V0
(lambda / (4*epsilon)) * Id0 + lambda epsilon D0^t D0
PrimalForm0 l_1_over_4
lambda 1/4 1
Scalar getEpsilon() const
Scalar delta_v_l1
The L1-norm of variation of v.
DiscreteExteriorCalculusSolver< Calculus, LinearAlgebraSolver, 2, PRIMAL, 2, PRIMAL > SolverU
void setAlpha(Scalar _alpha, const PrimalForm2 &m)
PrimalDerivative1 M12
edge_to_face average operator
std::vector< PrimalForm2 > g2
The g 2-forms.
const PrimalForm2 & getU(int i) const
DiscreteExteriorCalculusSolver< Calculus, LinearAlgebraSolver, 0, PRIMAL, 0, PRIMAL > SolverV
double alpha
Smoothness parameter alpha of AT (in 1/area unit)
PrimalDerivative0 M01
point_to_edge average operator
std::vector< PrimalForm2 > alpha_g2
alpha g2
void setMetricAverage(bool average)
Use metric average to smooth L1-metric effects.
const PrimalForm2 & getG(int i) const
void setAlpha(Scalar _alpha)
unsigned int size0() const
ATu2v0 & operator=(const ATu2v0 &other)=delete
PrimalIdentity2 alpha_Id2
alpha Id2
void setLambda(Scalar _lambda)
DECImage2D< TKSpace, TLinearAlgebra > Base
const PrimalForm0 & getV() const
Aim: This class simplifies the development of 2D image processing tools using discrete exterior calcu...
Calculus::DualAntiderivative1 DualAntiderivative1
int verbose
The verbose level (0: silent).
DualDerivative0 dual_D0
dual derivative dual 0-form -> dual 1-form
Calculus::DualDerivative0 DualDerivative0
Calculus::PrimalHodge2 PrimalHodge2
PrimalHodge2 primal_h2
hodge star: 2-form -> dual 2-form
PrimalDerivative0 D0
primal derivative: 0-form -> 1-form
Calculus calculus
The discrete exterior calculus instance.
DualHodge0 dual_h0
hodge star: dual 0-form -> 0-form
Calculus::PrimalForm1 PrimalForm1
Calculus::DualHodge2 DualHodge2
Calculus::PrimalAntiderivative1 PrimalAntiderivative1
DualHodge1 dual_h1
hodge star: dual 1-form -> 1-form
HyperRectDomain< Space > Domain
Calculus::PrimalDerivative0 PrimalDerivative0
Calculus::PrimalForm0 PrimalForm0
RealVector::Component Scalar
Calculus::PrimalForm2 PrimalForm2
Calculus::PrimalDerivative1 PrimalDerivative1
DualHodge2 dual_h2
hodge star: dual 2-form -> 2-form
PrimalHodge0 primal_h0
hodge star: 0-form -> dual 0-form
Calculus::PrimalIdentity0 PrimalIdentity0
PrimalHodge1 primal_h1
hodge star: 1-form -> dual 1-form
Space::RealVector RealVector
Calculus::DualAntiderivative2 DualAntiderivative2
Calculus::DualHodge1 DualHodge1
DiscreteExteriorCalculus< 2, 2, LinearAlgebra > Calculus
Calculus::PrimalHodge1 PrimalHodge1
Calculus::PrimalIdentity2 PrimalIdentity2
Calculus::PrimalIdentity1 PrimalIdentity1
Calculus::PrimalHodge0 PrimalHodge0
Calculus::DualHodge0 DualHodge0
Calculus::PrimalAntiderivative2 PrimalAntiderivative2
PrimalDerivative1 D1
primal derivative: 1-form -> 2-form
Calculus::DualDerivative1 DualDerivative1
DualDerivative1 dual_D1
dual derivative dual 1-form -> dual 2-form