TVPenalty¶
template <typename T1> class TVPenalty : public Robject<T1>
Approximate total-variation (TV) regularization penalty.
Smooth approximation to total variation using the hyperbola (Charbonnier) potential:
Derivative (used by dpot):
$\(\dot\psi(d) = \frac{d}{\sqrt{1 + (d/\delta)^2}}\)$
Weight (used by wpot):
$\(\omega(d) = \frac{1}{\sqrt{1 + (d/\delta)^2}}\)$
Behaves quadratically near zero (\(\psi(d) \approx \frac{1}{2}d^2\) for \(|d| \ll \delta\)) and linearly for large differences (\(\psi(d) \approx \delta|d|\) for \(|d| \gg \delta\)).
\(\delta\) controls the transition from quadratic to linear behavior. Smaller \(\delta\) = sharper edges, closer to true TV, but harder optimization.
TVPenalty<float> R(Nx, Ny, Nz, beta, delta);
auto xhat = solve_pwls_pcg<float>(x0, G, W, yi, R, niter);
See : Rudin, Osher & Fatemi, "Nonlinear Total Variation Based Noise Removal Algorithms," Physica D, 1992. https://doi.org/10.1016/0167-2789(92)90242-F
See : QuadPenalty for a purely quadratic alternative.
See : Robject for the base class interface.
T1
: Floating-point precision type (float or double).
Variables¶
| Name | Description |
|---|---|
| Delta | Smoothing parameter \(\delta\) for the Charbonnier potential approximation. |
Functions¶
| Name | Description |
|---|---|
| TVPenalty | Default constructor. |
| TVPenalty | Construct an approximate TV penalty operator. |
| wpot | TV weight function: \(\omega(d) = 1 / \sqrt{1 + (d/\delta)^2}\). d : Finite-difference vector. Return : Per-element weights, same length as d. |
| dpot | TV derivative: \(\dot\psi(d) = d / \sqrt{1 + (d/\delta)^2}\). d : Finite-difference vector. Return : Per-element derivatives, same length as d. |
| pot | TV potential: \(\psi(d) = \delta^2(\sqrt{1 + (d/\delta)^2} - 1)\). d : Finite-difference vector. Return : Per-element potential values, same length as d. |
Variable Details¶
Delta¶
T1 Delta
Smoothing parameter $\delta$ for the Charbonnier potential approximation.
Function Details¶
TVPenalty¶
TVPenalty()
Default constructor.
TVPenalty(uword nx, uword ny, uword nz, T1 beta, T1 delta, uword dims2penalize = 3)
Construct an approximate TV penalty operator.
nx
: Image x-dimension.
ny
: Image y-dimension.
nz
: Image z-dimension (use 1 for 2-D).
beta
: Regularization strength \(\beta\).
delta
: Smoothing parameter \(\delta > 0\); smaller values approach exact TV.
dims2penalize
: Number of spatial dimensions to penalize (default 3).
dpot¶
Col<CxT1> dpot(const Col<CxT1>& d) const override
TV derivative: $\dot\psi(d) = d / \sqrt{1 + (d/\delta)^2}$.
d
: Finite-difference vector.
Return
: Per-element derivatives, same length as d.
pot¶
Col<CxT1> pot(const Col<CxT1>& d) const override
TV potential: $\psi(d) = \delta^2(\sqrt{1 + (d/\delta)^2} - 1)$.
d
: Finite-difference vector.
Return
: Per-element potential values, same length as d.
wpot¶
Col<CxT1> wpot(const Col<CxT1>& d) const override
TV weight function: $\omega(d) = 1 / \sqrt{1 + (d/\delta)^2}$.
d
: Finite-difference vector.
Return
: Per-element weights, same length as d.