33 #if defined(ATVu2v0_RECURSES)
34 #error Recursive header files inclusion detected in ATVu2v0.h
37 #define ATVu2v0_RECURSES
39 #if !defined ATVu2v0_h
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"
75 template <
typename TKSpace,
76 typename TLinearAlgebra = EigenLinearAlgebraBackend >
124 typedef DiscreteExteriorCalculusSolver<Calculus, LinearAlgebraSolver, 2, PRIMAL, 2, PRIMAL>
126 typedef DiscreteExteriorCalculusSolver<Calculus, LinearAlgebraSolver, 0, PRIMAL, 0, PRIMAL>
204 template <
typename Image,
typename Function>
207 bool perfect_data =
false );
299 unsigned int size0()
const {
return v0.myContainer.rows(); }
364 std::vector< PrimalForm2 >
g2;
366 std::vector< PrimalForm2 >
i2;
368 std::vector< PrimalForm2 >
u2;
419 template <
typename TKSpace,
typename TLinearAlgebra>
429 #include "ATVu2v0.ih"
436 #undef ATVu2v0_RECURSES
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
Aim: This class solves a variant of Ambrosio-Tortorelli functional in a plane for u a (vector of) 2-f...
const PrimalForm2 & getG(int i) const
DiscreteExteriorCalculusSolver< Calculus, LinearAlgebraSolver, 0, PRIMAL, 0, PRIMAL > SolverV
PrimalDerivative0 M01
point_to_edge average operator
Scalar getEpsilon() const
LinearAlgebra::SolverSimplicialLLT LinearAlgebraSolver
Scalar computeSNR() const
Computes the SNR of u wrt ideal input (should have been given.
PrimalForm0 v0
The v 0-form.
void selfDisplay(std::ostream &out) const
void setUFromInputAndMask()
PrimalIdentity2 alpha_Id2
alpha Id2
PrimalForm0 former_v0
The v 0-form at the previous iteration.
PrimalIdentity0 primal_L0
primal laplace operator on 0-forms
Scalar delta_v_loo
The Linfinity-norm of variation of v.
PrimalAntiderivative2 primal_AD2
Antiderivative 2-form -> to 1-form.
TLinearAlgebra LinearAlgebra
void setMetricAverage(bool average)
Use metric average to smooth L1-metric effects.
std::vector< PrimalForm2 > alpha_g2
alpha g2
ATVu2v0(const ATVu2v0 &other)=delete
SolverV solver_v
The solver for 0-form v.
Calculus::PrimalDerivative0 PrimalDerivative0
Calculus::PrimalForm0 PrimalForm0
RealVector::Component Scalar
Calculus::PrimalForm2 PrimalForm2
double alpha
Smoothness parameter alpha of AT (in 1/area unit)
Calculus::PrimalDerivative1 PrimalDerivative1
PrimalDerivative1 M12
edge_to_face average operator
void setAlpha(Scalar _alpha, const PrimalForm2 &m)
Calculus::PrimalIdentity0 PrimalIdentity0
DECImage2D< TKSpace, TLinearAlgebra > Base
ATVu2v0(ATVu2v0 &&other)=delete
const PrimalForm2 & getU(int i) const
double epsilon
Thickness of discontinuity set (in length unit).
std::vector< PrimalForm2 > u2
The u 2-forms.
PrimalForm0 l_over_e_1
lambda/epsilon 1
void setLambda(Scalar _lambda)
DiscreteExteriorCalculusSolver< Calculus, LinearAlgebraSolver, 2, PRIMAL, 2, PRIMAL > SolverU
std::vector< PrimalForm2 > g2
The g 2-forms.
void init(Clone< KSpace > K)
unsigned int size0() const
PrimalIdentity0 l_over_e_Id0
lambda/epsilon Id0
double lambda
Amount of discontinuity parameter lambda (in 1/length unit).
ATVu2v0 & operator=(const ATVu2v0 &other)=delete
Calculus::PrimalIdentity2 PrimalIdentity2
Scalar delta_v_l1
The L1-norm of variation of v.
PrimalIdentity0 left_V0
(lambda / (4*epsilon)) * Id0 + lambda epsilon D0^t D0
const PrimalForm0 & getV() const
void addInput(const Image &image, const Function &f, bool perfect_data=false)
void setAlpha(Scalar _alpha)
Scalar delta_v_l2
The L2-norm of variation of v.
Scalar computeVariation()
SolverU solver_u
The solver for every 2-form u[i].
BOOST_STATIC_ASSERT((KSpace::dimension==2))
Calculus::PrimalAntiderivative2 PrimalAntiderivative2
void setEpsilon(Scalar _epsilon)
std::vector< PrimalForm2 > i2
The ideal input 2-forms (for snr computation).
bool metric_average
When 'true', use metric average, otherwise use identity.
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