Stripe removal (optix.destripe)
Estimators
Stripe artifact removal.
Building blocks (wavelet transforms, damping, difference operators, VSNR
filters and solver) are in optix.destripe.utils.
WaveletFFT
WaveletFFT(*, wavelet=None, level=None, sigma=None, axis=None, levels=None, bands=None, sigma_background=None, threshold=None, crossover=None, smoothing=None, log_transform=None, sigma_units=None, pad_even=None, faithful=True, dtype=None, device=None, layout=None)
Bases: Estimator
Stripe removal by combined wavelet–Fourier filtering.
The filter of Münch et al. (2009),
applied to every frame independently: see
wavelet_fft for the method. It has no
parameters to fit: fit only records the
layout, and apply streams the frames in batches,
so arrays larger than memory (zarr, memmap) can be processed.
Note
The paper leaves its three parameters (wavelet, highest level L, damping width σ) to be tuned to the data (Section 4.4). The defaults, db10, L = 4 and σ = 1.5, are the paper's suggestions for typical data (Section 3.8); any value is faithful to the paper.
Extensions from pystripe
The options bands, sigma_background, threshold, crossover,
smoothing, log_transform, sigma_units and pad_even, and a
flat-field and dark-offset correction given to
fit as a
ShadingEstimate, add the
filtering options of pystripe
(Swaney et al. 2019); see
wavelet_fft. They are off by
default; their equations are from the pystripe code, not in the
paper. With pystripe's settings (db3, level="max",
log_transform=True, sigma_units="pystripe", pad_even=True,
axis=-1), the filter matches pystripe's filter_streaks up to
its final cast to uint16.
References
- Münch B, Trtik P, Marone F, Stampanoni M. Stripe and ring artifact removal with combined wavelet — Fourier filtering. Opt Express 17(10):8567–8591, 2009. doi:10.1364/OE.17.008567
BibTeX
@article{munch2009stripe,
author = {Münch, Beat and Trtik, Pavel and Marone,
Federica and Stampanoni, Marco},
title = {Stripe and ring artifact removal with combined
wavelet --- {Fourier} filtering},
journal = {Optics Express},
volume = {17}, number = {10}, pages = {8567--8591},
year = {2009}, doi = {10.1364/OE.17.008567}
}
Configure the filter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wavelet
|
str
|
|
`"db10"`
|
level
|
int or `"max"`
|
Highest decomposition level L ≥ 1, or |
4
|
sigma
|
float or sequence of float
|
Damping width σ ≥ 0 of Eq. (9) (one value, or one per level, finest first); the foreground bandwidth in the dual-band modes. The three defaults are the paper's suggestions for typical data (Section 3.8). |
1.5
|
axis
|
int or str
|
Spatial axis along which the stripes run: a position among the
two spatial axes of the layout (0 or -2: the first, 1 or -1:
the second), or an axis label of the layout (e.g. |
None
|
levels
|
sequence of int
|
Detail levels to filter (1 is the finest); default: all. |
None
|
bands
|
(single, dual, foreground, background)
|
Intensity bands filtered (pystripe extension; |
"single"
|
sigma_background
|
float or sequence of float
|
Background bandwidth (pystripe extension), required by
|
None
|
threshold
|
float
|
Background/foreground threshold (pystripe extension; default: Otsu's threshold of each frame). |
None
|
crossover
|
float
|
Intensity range of the transition between the bands (pystripe extension). |
10
|
smoothing
|
float
|
Width, in pixels, of the Gaussian smoothing of the foreground fraction (pystripe extension). |
1
|
log_transform
|
bool
|
Filter log(1 + data) (pystripe extension). |
False
|
sigma_units
|
(band, pystripe)
|
Units of σ (pystripe extension: |
"band"
|
pad_even
|
bool
|
Pad odd frame sizes to even (pystripe extension). |
False
|
faithful
|
bool
|
See |
True
|
dtype
|
bool
|
See |
True
|
device
|
bool
|
See |
True
|
layout
|
bool
|
See |
True
|
fit
fit(data=None, *, layout=None, init=None, **kwargs)
Record the layout, and the flat field and dark offset if given.
The filter has no parameters to estimate. A
ShadingEstimate in init
adds pystripe's illumination correction after destriping,
x ← (x − d)/f, with its flat f and dark d (either may be
None; its per-frame baseline is not used). Its maps must
broadcast to (*group, *spatial): e.g. one map per group, one
map for all groups ((*spatial)), or a map that broadcasts over
some group axes (size 1 there). The shapes are checked when
data is given, and again by apply.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
array - like
|
Unused (its layout, if labelled, is recorded). |
None
|
layout
|
Layout
|
Recorded for |
None
|
init
|
ShadingEstimate
|
Flat field and dark offset (pystripe extension). |
None
|
**kwargs
|
object
|
Ignored ( |
{}
|
Returns:
| Type | Description |
|---|---|
WaveletFFT
|
self |
GeneralStripeRemover
GeneralStripeRemover(*, mu1=None, mu2=None, axis=None, angle=None, rho_z=None, normalize=None, box=None, max_iter=None, tol=None, faithful=True, dtype=None, device=None, layout=None)
Bases: Estimator
Variational stripe removal with intuitive parameters.
The method of Rottmayer et al. (2025), applied to every frame (or
volume) independently: see
general_stripe_remover for
the model, Eq. (1), and the solver. It has no parameters to fit:
fit only records the
layout, and apply streams the frames in
batches, so arrays larger than memory (zarr, memmap) can be processed.
With two spatial axes in the layout, frames are 2-D, as in all the results of the paper. With three, the first spatial axis (in layout order) is z and each volume is solved as a whole, ∇_z being weighted by ρ_z (Section 2.1.1).
For a negative angle, the authors' code mirrors the frame and solves
at the positive angle; optix keeps forward differences for every angle,
which gives a slightly different result with a lower objective. Mirror
the input (and the output) to reproduce the authors' result (see
general_stripe_remover).
Note
μ₁ and μ₂ are to be tuned to the data (Section 2.1.1), and any
value is faithful to the paper. The defaults μ₁ = 1/3, μ₂ = 1/300
are those of the authors' code at the time of publication; the
Discussion of the paper prints μ₁ = 1/30, read as a typographical
error (see
general_stripe_remover).
The paper runs 25000 PDHGMp iterations (Section 3), the faithful
default; faithful=False selects 1000, which the authors suggest
for the step sizes used here. Several stripe directions need a
larger μ₁ (of order 1) to remove anything; a UserWarning flags
settings that remove (nearly) nothing.
References
- Rottmayer N, Redenbach C, Fahrbach FO. A universal and effective variational method for destriping: application to light-sheet microscopy, FIB-SEM, and remote sensing images. Opt Express 33(3):5800–5809, 2025. doi:10.1364/OE.542868
- Burger M, Sawatzky A, Steidl G. First order algorithms in variational image processing. In: Glowinski R, Osher SJ, Yin W (eds), Splitting Methods in Communication, Imaging, Science, and Engineering, pp. 345–407. Springer, 2016. doi:10.1007/978-3-319-41589-5_10
BibTeX
@article{rottmayer2025universal,
author = {Rottmayer, Niklas and Redenbach, Claudia and
Fahrbach, Florian O.},
title = {A universal and effective variational method for
destriping: application to light-sheet microscopy,
{FIB-SEM}, and remote sensing images},
journal = {Optics Express},
volume = {33}, number = {3}, pages = {5800--5809},
year = {2025}, doi = {10.1364/OE.542868}
}
@incollection{burger2016first,
author = {Burger, Martin and Sawatzky, Alex and
Steidl, Gabriele},
title = {First order algorithms in variational image
processing},
booktitle = {Splitting Methods in Communication, Imaging,
Science, and Engineering},
editor = {Glowinski, Roland and Osher, Stanley J. and
Yin, Wotao},
pages = {345--407}, publisher = {Springer},
year = {2016}, doi = {10.1007/978-3-319-41589-5_10}
}
Configure the method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu1
|
float
|
Weight μ₁ > 0 of the total variation: strength of the removal. |
1/3
|
mu2
|
float
|
Weight μ₂ > 0 of ‖s‖₁: precaution towards image structures. |
1/300
|
axis
|
int or str
|
Spatial axis along which the stripes run: a position among the
spatial axes of the layout (0 or -2: the first of two, 1 or
-1: the second), or an axis label of the layout (e.g. |
None
|
angle
|
float or sequence of float
|
Stripe direction θ in degrees from |
0
|
rho_z
|
float
|
Weight ρ_z ∈ [0, 1] of ∇_z, for three spatial axes. |
0
|
normalize
|
bool
|
Rescale each frame to [0, 1] by its own range (and back), a choice of optix. |
True
|
box
|
bool
|
Keep ι_[0,1]ᴺ(u) (False is an extension). |
True
|
max_iter
|
int
|
Number of PDHGMp iterations (recommended: 1000). |
25000
|
tol
|
float
|
Per-frame stopping tolerance on the relative duality gap, as
|
None
|
faithful
|
bool
|
See |
True
|
dtype
|
bool
|
See |
True
|
device
|
bool
|
See |
True
|
layout
|
bool
|
See |
True
|
fit
fit(data=None, *, layout=None, **kwargs)
No-op: the method has no parameters to estimate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
array - like
|
Unused (its layout, if labelled, is recorded). |
None
|
layout
|
Layout
|
Recorded for |
None
|
**kwargs
|
object
|
Ignored ( |
{}
|
Returns:
| Type | Description |
|---|---|
GeneralStripeRemover
|
self |
VSNR
VSNR(filters=None, *, alpha=None, prior=None, eps=None, bound=None, tol=None, max_iter=None, tau=None, sigma=None, faithful=True, dtype=None, device=None, layout=None)
Bases: Estimator
Variational stationary noise remover (VSNR).
The method of Fehrenbach et al. (2012), applied to every frame
independently: see vsnr for the model and
vsnr_solve for the solver. It
has no parameters to fit: fit only
records the layout, and apply streams the
frames in batches, so arrays larger than memory (zarr, memmap) can be
processed.
Note
The noise patterns kⱼ, the priors φⱼ and their weights αⱼ describe the data and are chosen by the user (Section III); the paper gives no defaults for them. The filters are 2-D kernels over the two spatial axes of the layout, in layout order.
References
- Fehrenbach J, Weiss P, Lorenzo C. Variational algorithms to remove stationary noise: applications to microscopy imaging. IEEE Trans Image Process 21(10):4420–4430, 2012. doi:10.1109/TIP.2012.2206037
BibTeX
@article{fehrenbach2012variational,
author = {Fehrenbach, Jérôme and Weiss, Pierre
and Lorenzo, Corinne},
title = {Variational algorithms to remove stationary
noise: applications to microscopy imaging},
journal = {IEEE Transactions on Image Processing},
volume = {21}, number = {10}, pages = {4420--4430},
year = {2012}, doi = {10.1109/TIP.2012.2206037}
}
Configure the solver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filters
|
Tensor or sequence of Tensor
|
Noise patterns kⱼ (required): |
None
|
alpha
|
float or sequence of float
|
Prior weights αⱼ > 0 (required), one value or one per filter. |
None
|
prior
|
str or sequence of str
|
φⱼ: |
`"l1"`
|
eps
|
float
|
Huber parameter ε of the image prior (0: total variation). |
0
|
bound
|
float
|
Box bound C; default: derived from each frame. |
None
|
tol
|
float
|
Relative duality gap at which to stop (the paper's value). |
1e-3
|
max_iter
|
int
|
Iteration cap per frame. |
1000
|
tau
|
float
|
Initial primal and dual steps. |
None
|
sigma
|
float
|
Initial primal and dual steps. |
None
|
faithful
|
bool
|
See |
True
|
dtype
|
bool
|
See |
True
|
device
|
bool
|
See |
True
|
layout
|
bool
|
See |
True
|
fit
fit(data=None, *, layout=None, **kwargs)
Transforms
Stripe artifact removal.
Building blocks (wavelet transforms, damping, difference operators, VSNR
filters and solver) are in optix.destripe.utils.
wavelet_fft
wavelet_fft(data, *, wavelet='db10', level=4, sigma=1.5, axis=-2, levels=None, bands='single', sigma_background=None, threshold=None, crossover=10.0, smoothing=1.0, log_transform=False, sigma_units='band', pad_even=False, flat=None, dark=None)
Remove stripes with the combined wavelet–FFT filter.
Each frame f(x, y), with stripes along y (constant offsets over the whole frame, Eq. (8)), is processed as in Münch et al. (2009), Fig. 5:
- multilevel 2-D DWT down to level L (Eq. (6)), giving the vertical detail bands c_{v,l} (low pass along y, high pass along x), l = 1, …, L;
- 1-D FFT of each c_{v,l} along y, ĉ_{v,l}(x, ŷ);
- damping by the Gaussian band-stop of Eq. (9), ĉ′v,l = ĉ · (1 − exp(−ŷ²/(2σ²))), which removes the stripe information condensed on the line ŷ = 0;
- inverse FFT, then inverse DWT.
The DWT uses symmetric (mirror) boundary extension (Section 2.3) and
the Daubechies filters dbN of the paper; see
wavedec2. The FFT runs along the
stripes over the whole band: the paper does not specify padding or
windowing, and none is applied.
The default arguments give this filter. The other arguments are opt-in extensions from pystripe (Swaney et al. 2019), described below; their equations are from the pystripe code, not in the paper, which only names the dual-band mode, the crossover and the flat-field correction.
Extensions from pystripe
Write W(y; σ) for the filter above with bandwidth σ (one value, or one per level). From the pystripe code, not in the paper:
- Log domain (
log_transform=True): the filter runs on log(1 + y), W(y; σ) = exp(W₀(log(1 + y); σ)) − 1, with W₀ the linear filter. -
Dual-band filtering (
bands): with a threshold t (Otsu's threshold of the frame,otsu_threshold, unless given) and the foreground fractionχ = G_s ∗ sigmoid((y − t)/c),
with c the crossover and G_s a Gaussian of width s =
smoothing pixels, the frame is split into a background
min(y, t) and a foreground max(y, t), filtered with their own
bandwidths σ_bg (sigma_background) and σ_fg (sigma), and
blended:
x = χ · W(max(y, t); σ_fg) + (1 − χ) · W(min(y, t); σ_bg).
bands="foreground" replaces the background term by y itself
(only the foreground is filtered), bands="background" the
foreground term. With bands="dual" and σ_fg = σ_bg the frame
is not split: the filter is the single-band one.
- Bandwidth mapping (sigma_units="pystripe"): σ is given in
pixels of the frame, and level l uses σ_l = σ · n_l / n, with
n_l and n the sizes of the band and of the frame across the
stripes. The damping is the Gaussian of Eq. (9) evaluated on
the index j = 0, …, m − 1 of the real FFT of length m stored in
the packed (real, imaginary) order of scipy.fftpack.rfft:
the real part of frequency k is damped by g(2k − 1), its
imaginary part by g(2k).
- Even padding (pad_even=True): frames of odd size are
padded to even size by repeating their last row or column, and
cropped back after filtering. The threshold is computed before
padding.
- Flat-field and dark-offset correction (flat, dark):
after destriping, x ← (x − d)/f. pystripe normalises its flat
field to a maximum of 1 before use; flat is used as given.
pystripe's other defaults are db3, level="max", crossover=10,
and Otsu's threshold. Its output is clipped to [0, 2¹⁶ − 1] and
cast to uint16; here it stays floating point.
References
- Münch B, Trtik P, Marone F, Stampanoni M. Stripe and ring artifact removal with combined wavelet — Fourier filtering. Opt Express 17(10):8567–8591, 2009. doi:10.1364/OE.17.008567
- Swaney J, Kamentsky L, Evans NB, Xie K, Park Y-G, Drummond G, Yun DH, Chung K. Scalable image processing techniques for quantitative analysis of volumetric biological images from light-sheet microscopy. bioRxiv 576595, 2019. doi:10.1101/576595 Code: pystripe (MIT licence, Copyright (c) 2018 Chung Lab).
BibTeX
@article{munch2009stripe,
author = {Münch, Beat and Trtik, Pavel and Marone,
Federica and Stampanoni, Marco},
title = {Stripe and ring artifact removal with combined
wavelet --- {Fourier} filtering},
journal = {Optics Express},
volume = {17}, number = {10}, pages = {8567--8591},
year = {2009}, doi = {10.1364/OE.17.008567}
}
@article{swaney2019scalable,
author = {Swaney, Justin and Kamentsky, Lee and Evans,
Nicholas B. and Xie, Katherine and Park,
Young-Gyun and Drummond, Gabrielle and Yun,
Dae Hee and Chung, Kwanghun},
title = {Scalable image processing techniques for
quantitative analysis of volumetric biological
images from light-sheet microscopy},
journal = {bioRxiv},
pages = {576595},
year = {2019}, doi = {10.1101/576595}
}
Note
The defaults (db10, L = 4, σ = 1.5) are the paper's suggestions for typical data (Section 3.8: σ = 1.5 and L = 4 remove the visible stripes of the Lena image and of the tomography data of Section 4.2, and db10–db15 is the recommended wavelet size). Heavier or wider stripes need a larger L or σ (σ = 7 and L = 8 for the FIB-nt image of Section 4.1).
The filter is linear and stateless, and costs O(N·F) for N pixels and a filter of length F. The log domain and the dual-band mode make it non-linear; the dual-band mode filters two images.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Tensor
|
Frames |
required |
wavelet
|
str or Wavelet
|
|
`"db10"`
|
level
|
int or `"max"`
|
Highest decomposition level L ≥ 1 ( |
4
|
sigma
|
float or sequence of float
|
Damping width σ ≥ 0 of Eq. (9), in frequency samples of each band;
0 is the limit σ → 0 (ideal stripes). One value for all levels
(as in the paper), or one per level, finest first (Section 2.3
mentions adapting σ to each level). In the dual-band modes, the
foreground bandwidth (pystripe's |
1.5
|
axis
|
(-2, -1)
|
Frame axis along which the stripes run: -2 for stripes along the
rows axis (vertical stripes in an |
-2
|
levels
|
sequence of int
|
Detail levels to filter (1 is the finest); default: all of 1, …, L, as in Fig. 5. Section 3.6 discusses filtering a subset of the levels. |
None
|
bands
|
(single, dual, foreground, background)
|
Which intensity bands are filtered (see the note above):
|
"single"
|
sigma_background
|
float or sequence of float
|
Background bandwidth σ_bg (pystripe's |
None
|
threshold
|
float
|
Intensity t separating background and foreground. Default:
Otsu's threshold of each frame (256 bins, or one bin per integer
value for integer |
None
|
crossover
|
float
|
Intensity range c of the transition between the bands. |
10
|
smoothing
|
float
|
Width, in pixels, of the Gaussian smoothing the foreground fraction (fixed to 1 in pystripe); 0 for none. |
1
|
log_transform
|
bool
|
Filter log(1 + data) (pystripe). |
False
|
sigma_units
|
(band, pystripe)
|
|
"band"
|
pad_even
|
bool
|
Pad frames of odd size to even size before filtering (pystripe). |
False
|
flat
|
Tensor
|
Flat field f, broadcasting against the frames ( |
None
|
dark
|
Tensor or float
|
Dark offset d, subtracted before dividing by |
None
|
Returns:
| Type | Description |
|---|---|
Tensor
|
Destriped frames, of the shape of |
general_stripe_remover
general_stripe_remover(data, *, mu1=1 / 3, mu2=1 / 300, axis=-2, angle=0.0, rho_z=0.0, ndim=2, normalize=True, box=True, max_iter=25000, tol=None)
Remove stripes with the variational model of Rottmayer et al. (2025).
Each frame u₀ (or volume, if ndim is 3) is split into a clean image
u and stripes s by solving Eq. (1) of the paper,
argmin_{u + s = u₀} μ₁‖∇u‖₂,₁ + ι_[0,1]ᴺ(u) + ‖∇_θ s‖₁ + μ₂‖s‖₁,
‖∇u‖₂,₁ = ∑ √((∇ₓu)² + (∇ᵧu)² + (ρ_z ∇_z u)²) (Eq. (2)).
The total variation (Eq. (2)) favours clean images with few strong
edges, ‖∇θ s‖₁ stripes that vary little along their direction θ,
μ₂‖s‖₁ sparse stripes, and the indicator ι[0,1]ᴺ keeps u in the value
range of the input. μ₁ sets the strength of the removal and μ₂ the
precaution towards image structures (Section 2.1.1). Several stripe
directions θᵢ add one term ‖∇_θᵢ s‖₁ each, all on the same s, as
written in Section 2.1.1. Notation: the paper's u₀ is data, rescaled
to [0, 1] when normalize.
The problem is solved with the primal–dual hybrid gradient method with
extrapolation of the dual variable (PDHGMp, Burger et al., 2016) for
max_iter iterations, from u = u₀, s = 0. Differences are forward
differences with a zero (Neumann) boundary; the oblique ∇_θ uses the
lattice offsets of stripe_offset.
Frames are processed independently, all frames of a batch at once.
Settings not specified in the paper
The paper names the algorithm (PDHGMp) and the problem, but not the following, which follow the authors' code (General-Stripe-Removal, MIT licence): the initialisation, the forward differences with zero boundary, the rounding of θ to lattice directions, and the step sizes τ = σ = 0.35 in 2-D and 0.28 with ρ_z > 0 (reduced so that τσ‖K‖² < 1 when several directions are given).
- Step sizes and iterations. The balanced steps τ = σ are
those of the authors' current code. The code used for the
results of the paper weighted the stripe term by 30 (it solved
30 × Eq. (1)) with the same τ = σ = 0.35, which is PDHGMp on
Eq. (1) with τ = 10.5 and σ = 0.35/30 ≈ 0.0117; the 25000
iterations of the paper (Section 3) refer to that balance. Both
converge to a minimiser of Eq. (1), along different paths. With
the balanced steps, the authors now suggest about 1000
iterations, the
recommendedvalue ofGeneralStripeRemover;max_iter= 25000 is kept as the faithful default. - Normalisation.
normalizerescales each frame (or volume) to [0, 1] by its own minimum and maximum, the range Eq. (1) assumes, and maps the result back to the input range. This is a choice of optix: the authors rescale the whole image or stack once. - ρ_z. ρ_z weights ∇_z in both the forward operator ∇ and its adjoint ∇ᵀ, as Eq. (2) implies. The authors' code applies it in the adjoint only, so 3-D results with 0 < ρ_z < 1 differ from theirs.
- Negative angles. The authors' code mirrors the frame across the stripe axis and solves at the positive angle, which turns the total variation into a backward difference across the stripes. optix keeps forward differences for every angle, which gives a slightly different result with a lower objective. Mirroring the input (and the output) and passing the positive angle reproduces the authors' result.
Defaults
μ₁ = 1/3 and μ₂ = 1/300. The Discussion of the paper prints
μ₁ = 1/30 and μ₂ = 1/300. The authors' code at the time of
publication (before the commit "Improved GSR" of 29 July 2025)
weights ‖∇_y s‖₁ by λ = 30 with defaults μ = (10, 0.1), and its
processing script states that "compared to the paper mu is
rescaled by a factor of 30": μ₁ = 10/30 = 1/3 and μ₂ = 0.1/30 =
1/300 in the units of Eq. (1). μ₂ agrees with the Discussion and
μ₁ does not, so 1/30 is read as a typographical error for 1/3; the
authors' current code defaults to the same values (0.33, 0.003).
Increase μ₁ for stronger removal, μ₂ for more caution. Each
iteration costs O(|Ω|·m) for |Ω| pixels and m stripe directions: on
one CPU thread, about 1 ms at 256 × 256 and 25 ms at 1024 × 1024
per iteration in float32 for one direction, i.e. about 10 min for
a 1024 × 1024 frame at 25000 iterations and 25 s at 1000. On
synthetic 96 × 96 frames, the relative duality gap (see tol) is
of order 10⁻¹ to 10⁻² after 1000 iterations and 10⁻³ to 10⁻⁴
after 25000.
Several directions
With a shared s, each term ‖∇_θᵢ s‖₁ also penalises the stripes of the other directions, with weight 1, so stripes are removed only for μ₁ of order 1, larger than for a single direction.
- For the orthogonal pair 0° and 90°, D_y and D_x are the components of ∇, so ‖D_y s‖₁ + ‖D_x s‖₁ ≥ ‖∇s‖₂,₁ and, for μ₁ ≤ 1, E(u) ≥ μ₁‖∇u₀‖₂,₁ + μ₂‖s‖₁: u = u₀ is the unique minimiser and nothing is removed.
- For other pairs the threshold is lower and depends on the data. On synthetic frames, removal starts between μ₁ = 1/2 and 0.6 for 0° + 45° and for ±45°; at μ₁ = 0.7, 0° + 45° removes both families of stripes better than either direction alone.
A UserWarning is emitted with several directions when μ₁ ≤ 1 for
a 0°/90° pair, or μ₁ ≤ 1/2 otherwise.
Extensions
tol stops each frame when the duality gap Δ(uₖ, pₖ) = E(uₖ) −
D(pₖ) of Eq. (1) falls to tol · Δ(u₀, p₀), its initial value
μ₁‖∇u₀‖₂,₁ (checked every 10 iterations), the same relative
criterion as tol of optix.destripe.VSNR. It needs the
indicator ι_[0,1]ᴺ (box=True), without which the dual is
unbounded. box=False drops ι_[0,1]ᴺ. Both depart from the paper.
References
- Rottmayer N, Redenbach C, Fahrbach FO. A universal and effective variational method for destriping: application to light-sheet microscopy, FIB-SEM, and remote sensing images. Opt Express 33(3):5800–5809, 2025. doi:10.1364/OE.542868
- Burger M, Sawatzky A, Steidl G. First order algorithms in variational image processing. In: Glowinski R, Osher SJ, Yin W (eds), Splitting Methods in Communication, Imaging, Science, and Engineering, pp. 345–407. Springer, 2016. doi:10.1007/978-3-319-41589-5_10
BibTeX
@article{rottmayer2025universal,
author = {Rottmayer, Niklas and Redenbach, Claudia and
Fahrbach, Florian O.},
title = {A universal and effective variational method for
destriping: application to light-sheet microscopy,
{FIB-SEM}, and remote sensing images},
journal = {Optics Express},
volume = {33}, number = {3}, pages = {5800--5809},
year = {2025}, doi = {10.1364/OE.542868}
}
@incollection{burger2016first,
author = {Burger, Martin and Sawatzky, Alex and
Steidl, Gabriele},
title = {First order algorithms in variational image
processing},
booktitle = {Splitting Methods in Communication, Imaging,
Science, and Engineering},
editor = {Glowinski, Roland and Osher, Stanley J. and
Yin, Wotao},
pages = {345--407}, publisher = {Springer},
year = {2016}, doi = {10.1007/978-3-319-41589-5_10}
}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Tensor
|
Frames |
required |
mu1
|
float
|
Weight μ₁ > 0 of the total variation: strength of the removal. |
1/3
|
mu2
|
float
|
Weight μ₂ > 0 of ‖s‖₁: precaution towards image structures. |
1/300
|
axis
|
(-2, -1)
|
In-plane axis along which the stripes run (∇_y of the paper):
-2 for vertical stripes in an |
-2
|
angle
|
float or sequence of float
|
Stripe direction θ in degrees, from |
0
|
rho_z
|
float
|
Weight ρ_z ∈ [0, 1] of ∇_z (∇_z* = ρ_z ∇_z) in the total variation of volumes: 0 decouples the slices (2-D processing, as in all results of the paper), values below 1 trust the z axis less (e.g. a lower axial resolution). |
0
|
ndim
|
(2, 3)
|
Number of trailing spatial dims of a frame; with 3, the first one is z. |
2
|
normalize
|
bool
|
Rescale each frame to [0, 1] by its minimum and maximum before
solving, and back afterwards (a choice of optix, see above). With
False, |
True
|
box
|
bool
|
Keep the indicator ι_[0,1]ᴺ(u) of Eq. (1). False is an extension. |
True
|
max_iter
|
int
|
Number of PDHGMp iterations (an upper bound when |
25000
|
tol
|
float
|
Relative duality gap Δ(uₖ, pₖ)/Δ(u₀, p₀) at which a frame stops
(extension, needs |
None
|
Returns:
| Type | Description |
|---|---|
Tensor
|
Destriped frames u, of the shape of |
vsnr
vsnr(data, filters, *, alpha, prior='l1', eps=0.0, bound=None, tol=0.001, max_iter=1000, tau=None, sigma=None)
Remove stationary noise (stripes) with VSNR.
Notation follows the docs: y, x, s, kⱼ and h_ε stand for the paper's u₀, u, b, ψᵢ and φ_ε.
The variational stationary noise remover of Fehrenbach et al. (2012) models each frame as y = x + s (Eq. (6)), with a stationary noise
s = ∑ⱼ λⱼ ∗ kⱼ (Eq. (4)),
made of known patterns kⱼ (e.g. stripes) convolved with white noises λⱼ of densities p(λⱼ) ∝ exp(−φⱼ(λⱼ)) (Eq. (5)). The MAP estimate under the image prior p(x) ∝ exp(−‖∇x‖₂,₁^ε) (Eq. (8)) solves (9),
min_λ ‖∇(y − ∑ⱼ λⱼ ∗ kⱼ)‖₂,₁^ε + ∑ⱼ φⱼ(λⱼ),
where ‖g‖₂,₁^ε = ∑_{i∈Ω} h_ε(‖gᵢ‖₂) is the Huber-smoothed total variation
(h_ε(t) = t²/(2ε) for |t| ≤ ε, |t| − ε/2 otherwise; ε = 0 is the
total variation). The denoised frame is x = y − ∑ⱼ λⱼ ∗ kⱼ.
The problem is solved by the primal–dual algorithm of Chambolle and
Pock (Algorithms 1 and 2), stopped on the duality gap; see
vsnr_solve for the iteration,
the step sizes and the diagnostics.
References
- Fehrenbach J, Weiss P, Lorenzo C. Variational algorithms to remove stationary noise: applications to microscopy imaging. IEEE Trans Image Process 21(10):4420–4430, 2012. doi:10.1109/TIP.2012.2206037
- Chambolle A, Pock T. A first-order primal-dual algorithm for convex problems with applications to imaging. J Math Imaging Vis 40(1):120–145, 2011. doi:10.1007/s10851-010-0251-1
BibTeX
@article{fehrenbach2012variational,
author = {Fehrenbach, Jérôme and Weiss, Pierre
and Lorenzo, Corinne},
title = {Variational algorithms to remove stationary
noise: applications to microscopy imaging},
journal = {IEEE Transactions on Image Processing},
volume = {21}, number = {10}, pages = {4420--4430},
year = {2012}, doi = {10.1109/TIP.2012.2206037}
}
@article{chambolle2011first,
author = {Chambolle, Antonin and Pock, Thomas},
title = {A first-order primal-dual algorithm for convex
problems with applications to imaging},
journal = {Journal of Mathematical Imaging and Vision},
volume = {40}, number = {1}, pages = {120--145},
year = {2011}, doi = {10.1007/s10851-010-0251-1}
}
Note
Each frame is processed independently (the convolutions are
periodic over the frame). The cost per iteration is 2m + 2 FFTs
of the frame size; the paper reports fewer than 50 iterations to
reduce the duality gap by 10³ with well-tuned steps
(Section VI-C). αⱼ sets the strength of each noise component and
depends on the amplitude of kⱼ: the paper leaves it to the user.
With ℓ¹ priors and ε = 0, the solution is equivariant to a
rescaling of the intensities (y → c y gives λ → c λ), so αⱼ
does not depend on the intensity unit. This does not hold for
ε > 0 (the Huber function is not 1-homogeneous), nor for
"linf" priors, whose bound αⱼ is in intensity units.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Tensor
|
Frames |
required |
filters
|
Tensor or sequence of Tensor
|
Noise patterns kⱼ: |
required |
alpha
|
float or sequence of float
|
Prior weights αⱼ > 0, one value or one per filter. |
required |
prior
|
str or sequence of str
|
φⱼ: |
`"l1"`
|
eps
|
float
|
Huber parameter ε of the image prior; 0 is total variation. |
0
|
bound
|
float
|
Box bound C of problem (11); default: a bound on ‖λ*‖∞ derived
from the data (see |
None
|
tol
|
float
|
Relative duality gap at which to stop (the paper's 10⁻³). |
1e-3
|
max_iter
|
int
|
Iteration cap per frame (not specified in the paper). |
1000
|
tau
|
float
|
Initial primal and dual steps (σ₀τ₀L² < 1); default: see
|
None
|
sigma
|
float
|
Initial primal and dual steps (σ₀τ₀L² < 1); default: see
|
None
|
Returns:
| Type | Description |
|---|---|
Tensor
|
Denoised frames x, of the shape of |
Utilities
No stability promise
optix.destripe.utils holds building blocks of the filters above; they may change without notice.
Building blocks of the stripe filters.
Semi-public: these may change without notice.
Wavelet
Wavelet(name, rec_lo)
Orthogonal wavelet filter bank.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Name, e.g. |
rec_lo, rec_hi, dec_lo, dec_hi |
tuple of float
|
Reconstruction and decomposition low- and high-pass filters, related as quadrature mirror filters:
with F the filter length. |
Build the filter bank from its reconstruction low-pass filter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the wavelet. |
required |
rec_lo
|
tuple of float
|
Reconstruction low-pass (scaling) filter, ∑ h = √2. |
required |
VSNRSolution
Bases: NamedTuple
Output of vsnr_solve.
Attributes:
| Name | Type | Description |
|---|---|---|
image |
Tensor
|
Denoised frames x = y − s, |
noise |
Tensor
|
Stationary noise s = ∑ⱼ λⱼ ∗ kⱼ, |
weights |
Tensor
|
Primal variables λ, |
dual |
Tensor
|
Dual variable q (the TV dual field), |
primal |
Tensor
|
P(λₖ) per iteration, |
gap |
Tensor
|
Duality gap Δ(λₖ, qₖ) per iteration, |
iterations |
Tensor
|
Iterations run per frame, |
bound |
Tensor
|
Box bound C per frame, |
get_wavelet
cached
get_wavelet(name)
dwt
dwt(x, wavelet, dim=-1)
Single-level 1-D DWT along dim.
With symmetric (half-sample mirror) extension of the signal, and the filters h (low pass) and g (high pass) of length F:
a[k] = ∑ⱼ dec_lo[j]·x[2k + 1 − j],
d[k] = ∑ⱼ dec_hi[j]·x[2k + 1 − j],
for k = 0, …, ⌊(N + F − 1)/2⌋ − 1. The convention (and the coefficients)
are those of Matlab's dwt in "sym" mode and PyWavelets' dwt in
"symmetric" mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Signal(s). |
required |
wavelet
|
str or Wavelet
|
See |
required |
dim
|
int
|
Dimension to transform. |
-1
|
Returns:
| Type | Description |
|---|---|
a, d : Tensor
|
Approximation and detail coefficients. |
idwt
idwt(a, d, wavelet, dim=-1)
Single-level 1-D inverse DWT along dim.
Inverse of dwt:
x[n] = ∑ₖ rec_lo[n + F − 2 − 2k]·a[k] + rec_hi[n + F − 2 − 2k]·d[k],
for n = 0, …, 2K − F + 1 with K coefficients. The output has the input
length of dwt when it was even, one more
sample when it was odd (as Matlab's idwt and PyWavelets' idwt).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
Tensor
|
Approximation and detail coefficients, of identical shapes. |
required |
d
|
Tensor
|
Approximation and detail coefficients, of identical shapes. |
required |
wavelet
|
str or Wavelet
|
|
required |
dim
|
int
|
|
-1
|
Returns:
| Type | Description |
|---|---|
Tensor
|
|
dwt2
dwt2(x, wavelet, dims=(-2, -1))
Single-level 2-D DWT over dims.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
|
required |
wavelet
|
str or Wavelet
|
|
required |
dims
|
(int, int)
|
Dimensions (first, second). |
(-2, -1)
|
Returns:
| Name | Type | Description |
|---|---|---|
a |
Tensor
|
Approximation (low pass along both dims). |
(h, v, d) : tuple of Tensor
|
Detail bands: high pass along the first dim and low pass along the
second ( |
idwt2
idwt2(a, details, wavelet, dims=(-2, -1))
wavedec2
wavedec2(x, wavelet, level, dims=(-2, -1))
Multilevel 2-D DWT (Mallat's pyramid).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
|
required |
wavelet
|
str or Wavelet
|
|
required |
level
|
int
|
Number of decompositions L ≥ 0. |
required |
dims
|
(int, int)
|
|
(-2, -1)
|
Returns:
| Type | Description |
|---|---|
list
|
|
waverec2
waverec2(coeffs, wavelet, dims=(-2, -1), shape=None)
Multilevel 2-D inverse DWT; inverse of
wavedec2.
Before each level, the approximation is cropped to the shape of the details of that level (it is one sample longer along a dimension whose length was odd at decomposition).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coeffs
|
list
|
|
required |
wavelet
|
str or Wavelet
|
|
required |
dims
|
(int, int)
|
|
(-2, -1)
|
shape
|
(int, int)
|
Shape of the original signal along |
None
|
Returns:
| Type | Description |
|---|---|
Tensor
|
|
max_level
max_level(n, wavelet)
Largest level at which the coefficients are at least one filter long.
⌊log₂(n/(F − 1))⌋ for a signal of length n and a filter of length F
(the bound used by PyWavelets' dwt_max_level and Matlab's
wmaxlev). Deeper levels are valid, but dominated by the boundary
extension.
stripe_damping
stripe_damping(n, sigma, *, dtype=None, device=None)
Gaussian band-stop of Münch et al. (2009), Eq. (9).
See Münch et al. (2009), Eq. (9):
g(ŷ) = 1 − exp(−ŷ²/(2σ²)),
on the non-negative frequency indices ŷ = 0, …, ⌊n/2⌋ of a real FFT of length n (the damping is even in ŷ). σ = 0 is the limit σ → 0: g(0) = 0 and g(ŷ) = 1 elsewhere.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
Length of the transformed signal. |
required |
sigma
|
float
|
Width σ ≥ 0, in frequency samples. |
required |
dtype
|
optional
|
|
None
|
device
|
optional
|
|
None
|
Returns:
| Type | Description |
|---|---|
Tensor
|
|
lattice_diff
lattice_diff(x, offset)
Forward difference along an integer lattice offset.
(D_v x)[i] = x[i + v] − x[i] if i + v lies in the grid, else 0,
on the trailing len(offset) dims of x. The offset (1, 0) is the
forward difference along the rows axis with the zero (Neumann)
boundary of a total-variation gradient; (2, 1) and (1, 1) are the
oblique differences used for stripes at about 26.6° and 45°.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
|
required |
offset
|
sequence of int
|
Lattice offset v, one integer per trailing dim. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
D_v x, of the shape of |
lattice_diff_adjoint
lattice_diff_adjoint(p, offset)
Adjoint D_vᵀ of lattice_diff.
It satisfies ⟨D_v x, p⟩ = ⟨x, D_vᵀ p⟩ for all x and p (values of p
outside the valid region of D_v are ignored).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p
|
Tensor
|
|
required |
offset
|
sequence of int
|
Lattice offset v. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
D_vᵀ p, of the shape of |
stripe_offset
stripe_offset(angle)
Lattice offset of the stripe difference ∇_θ for a stripe angle θ.
θ is in degrees, from the stripe axis towards the other in-plane axis (0: stripes along the stripe axis). It is rounded to the nearest of the directions 0°, ±26.6°, ±45°, ±63.4° and 90° (modulo 180°), whose offsets are (1, 0), (2, ±1), (1, ±1), (1, ±2) and (0, 1), counted along the stripe axis and across it.
Note
The paper replaces ∇_y by a directional difference ∇_θ for oblique stripes without specifying its discretisation; the rounding to these lattice directions follows the authors' code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
angle
|
float
|
Stripe angle θ in degrees. |
required |
Returns:
| Type | Description |
|---|---|
tuple of int
|
Offset |
general_stripe_objective
general_stripe_objective(u, data, *, mu1, mu2, offsets=((1, 0),), rho_z=0.0, volume=False)
Objective of Eq. (1) of Rottmayer et al. (2025), per frame.
E(u) = μ₁‖∇u‖₂,₁ + ∑ᵢ ‖∇_θᵢ s‖₁ + μ₂‖s‖₁, s = data − u,
without the indicator ι_[0,1]ᴺ(u), on frames whose stripes run along
dim -2 (offsets as in
stripe_offset).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
u
|
Tensor
|
Clean frames |
required |
data
|
Tensor
|
Observed frames u₀, of the shape of |
required |
mu1
|
float
|
Weights μ₁ and μ₂. |
required |
mu2
|
float
|
Weights μ₁ and μ₂. |
required |
offsets
|
sequence of (int, int)
|
Lattice offsets of the stripe differences ∇_θᵢ. |
((1, 0),)
|
rho_z
|
float
|
Weight ρ_z of ∇_z in the total variation (volumes only). |
0.0
|
volume
|
bool
|
Whether the frames are 3-D, z first. |
False
|
Returns:
| Type | Description |
|---|---|
Tensor
|
|
vsnr_solve
vsnr_solve(data, filters, *, alpha, prior='l1', eps=0.0, bound=None, tol=0.001, max_iter=1000, tau=None, sigma=None, history=False)
Primal–dual VSNR solver (Algorithms 1 and 2), with diagnostics.
Notation follows the docs: y, x, s, kⱼ, h_ε and ϑₖ stand for the paper's u₀, u, b, ψᵢ, φ_ε and θₖ.
Solves, for each frame y independently, problem (11) of Fehrenbach et al. (2012),
min_{λ ∈ Ξ} P(λ) = ‖∇(y − ∑ⱼ λⱼ ∗ kⱼ)‖₂,₁^ε + ∑ⱼ φⱼ(λⱼ),
Ξ = {λ : ‖λ‖∞ ≤ C},
through the saddle-point problem (13), min_λ max_q ⟨Aλ, q⟩ − F*(q) + G(λ), with Aλ = ∇(∑ⱼ λⱼ ∗ kⱼ), F(g) = ‖∇y − g‖₂,₁^ε and G = ∑ⱼ φⱼ + χ_Ξ. Each iteration of Algorithm 1 (Chambolle–Pock) is
qₖ₊₁ = (Id + σₖ∂F*)⁻¹(qₖ + σₖ A λ̄ₖ),
λₖ₊₁ = (Id + τₖ∂G)⁻¹(λₖ − τₖ A* qₖ₊₁),
λ̄ₖ₊₁ = λₖ₊₁ + ϑₖ (λₖ₊₁ − λₖ),
with the resolvents of Appendix A, from (λ₀, q₀) = (0, 0), until the
duality gap (15), Δ(λₖ, qₖ) = P(λₖ) − D(qₖ) with
D(q) = −F(q) − G(−A*q), falls to tol · Δ(λ₀, q₀).
The convolutions are periodic and computed by FFT; ∇ is the forward difference of Section II (zero at the last row and column), and ∇ᵀ = −div its exact adjoint. The step sizes follow Algorithm 2:
- all φⱼ = αⱼ/2 ‖·‖² and ε > 0: constant steps with μ = 2√(γε)/L, τ = μ/(2γ), σ = μ/(2ε), ϑ = 1/(1 + μ), γ = min αⱼ;
- all φⱼ = αⱼ/2 ‖·‖² and ε = 0: ϑₖ = 1/√(1 + 2γτₖ), τₖ₊₁ = ϑₖ τₖ, σₖ₊₁ = σₖ/ϑₖ;
- otherwise constant steps τ, σ and ϑ = 1;
with L the operator norm of Appendix B
(operator_norm).
References
- Fehrenbach J, Weiss P, Lorenzo C. Variational algorithms to remove stationary noise: applications to microscopy imaging. IEEE Trans Image Process 21(10):4420–4430, 2012. doi:10.1109/TIP.2012.2206037
- Chambolle A, Pock T. A first-order primal-dual algorithm for convex problems with applications to imaging. J Math Imaging Vis 40(1):120–145, 2011. doi:10.1007/s10851-010-0251-1
BibTeX
@article{fehrenbach2012variational,
author = {Fehrenbach, Jérôme and Weiss, Pierre
and Lorenzo, Corinne},
title = {Variational algorithms to remove stationary
noise: applications to microscopy imaging},
journal = {IEEE Transactions on Image Processing},
volume = {21}, number = {10}, pages = {4420--4430},
year = {2012}, doi = {10.1109/TIP.2012.2206037}
}
@article{chambolle2011first,
author = {Chambolle, Antonin and Pock, Thomas},
title = {A first-order primal-dual algorithm for convex
problems with applications to imaging},
journal = {Journal of Mathematical Imaging and Vision},
volume = {40}, number = {1}, pages = {120--145},
year = {2011}, doi = {10.1007/s10851-010-0251-1}
}
Choices not specified in the paper
- The paper asks for σ₀τ₀L² < 1 and leaves the split between σ₀ and τ₀ to experimental tuning (Section VI-C). Default: τ₀ = 0.99 s/L and σ₀ = 0.99/(s L), with s the mean gradient magnitude of the frame, ‖∇y‖₂,₁ / n (n pixels). Since λ scales with the data and q does not, this makes the iterates equivariant to a rescaling of the intensities.
- The box bound C must exceed ‖λ‖∞ (Section V-A). Default: the bound that follows from φⱼ(λⱼ) ≤ P(λ*) ≤ P(0), i.e. the maximum over j of P(0)/αⱼ (ℓ¹), √(2P(0)/αⱼ) (ℓ²) or αⱼ (ℓ∞ ball), per frame. The box is then inactive at the minimiser. With ℓ¹ priors this bound is loose; it does not enter the stopping rule (see the next item).
- For ℓ¹ components, D is evaluated at the dual-feasible point q/κ, κ = max(1, maxⱼ ‖(Aq)ⱼ‖∞/αⱼ) over those components, with the conjugate of φⱼ alone (the indicator of |ηⱼ| ≤ αⱼ), which is then zero. The gap is still an upper bound on P(λₖ) − P, and it does not depend on C.
- A
RuntimeWarningis emitted when frames reachmax_iterbeforetol(withtol> 0 andmax_iter> 0). With ℓ¹ priors and ε = 0 the rate is only O(1/k) (Proposition 5.3), so this is common. - Appendix A writes F(q) = ε/2 ‖q‖² − ⟨∇y, q⟩, which goes with x = y + ∑ⱼ λⱼ ∗ kⱼ. The sign used here, F(q) = ε/2 ‖q‖² + ⟨∇y, q⟩ (for ‖q‖∞ ≤ 1), goes with model (6), x = y − s; the two differ only by the sign of λ, as all the priors are even.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Tensor
|
Frames y, |
required |
filters
|
Tensor or sequence of Tensor
|
The m kernels kⱼ, |
required |
alpha
|
float or sequence of float
|
Weights αⱼ > 0 of the priors (one value, or one per filter). |
required |
prior
|
str or sequence of str
|
φⱼ, one value or one per filter (Section III-C):
|
`"l1"`
|
eps
|
float
|
Huber parameter ε ≥ 0 of ‖·‖₂,₁^ε (Eq. (8)); 0 is total variation. |
0
|
bound
|
float
|
Box bound C > 0; default: see above. |
None
|
tol
|
float
|
Relative duality gap at which a frame stops (the paper's ε = 10⁻³, Section VI-C). |
1e-3
|
max_iter
|
int
|
Iteration cap per frame (not specified in the paper). |
1000
|
tau
|
float
|
Initial steps τ₀, σ₀ (σ₀τ₀L² < 1). Ignored in the constant-step case of ℓ² priors with ε > 0, where Algorithm 2 sets them. |
None
|
sigma
|
float
|
Initial steps τ₀, σ₀ (σ₀τ₀L² < 1). Ignored in the constant-step case of ℓ² priors with ε > 0, where Algorithm 2 sets them. |
None
|
history
|
bool
|
Record P(λₖ) and Δ(λₖ, qₖ) at every iteration. |
False
|
Returns:
| Type | Description |
|---|---|
VSNRSolution
|
|
operator_norm
operator_norm(filters, shape, *, dtype=None, device=None)
Norm L = |||A||| of A: λ ↦ ∇(∑ⱼ λⱼ ∗ kⱼ), Appendix B.
With periodic differences, AAᵀ is block-diagonalised by the DFT, and
L² = max over k of Σ(k) (|d̂₁(k)|² + |d̂₂(k)|²), Σ(k) = ∑ⱼ |k̂ⱼ(k)|²,
with |d̂ⱼ(k)|² = 4 sin²(π kⱼ / nⱼ) the transfer function of a forward difference. The value bounds the norm of A with the differences of Section II (zero at the last row and column) from above.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filters
|
Tensor or sequence of Tensor
|
Kernels kⱼ, |
required |
shape
|
(int, int)
|
Frame shape. |
required |
dtype
|
optional
|
|
None
|
device
|
optional
|
|
None
|
Returns:
| Type | Description |
|---|---|
float
|
L. |
dirac
dirac(shape=(1, 1), *, dtype=None, device=None)
Dirac filter k = δ: white noise in the VSNR model.
With k = δ, the component λ ∗ k = λ is white noise (Section III of Fehrenbach et al. 2012), e.g. the Gaussian noise of the camera.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
(int, int)
|
Kernel shape; the impulse is at the centre |
`(1, 1)`
|
dtype
|
optional
|
|
None
|
device
|
optional
|
|
None
|
Returns:
| Type | Description |
|---|---|
Tensor
|
|
line
line(shape, axis=-2, *, layout=None, dtype=None, device=None)
Straight-line filter: stripes of one pixel width.
k = 1 on the line through the kernel centre along axis, 0
elsewhere. With a kernel as long as the frame, λ ∗ k is made of
stripes that run over the whole frame (Section VI-A, Table I of
Fehrenbach et al. 2012).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
(int, int)
|
Kernel shape; use the frame shape for stripes over the whole frame. |
required |
axis
|
int or str
|
Frame axis along which the line runs: a position among the two
spatial axes (0 or -2: the first, 1 or -1: the second), or an
axis label of |
-2
|
layout
|
Layout
|
Labelled layout in which a label |
None
|
dtype
|
optional
|
|
None
|
device
|
optional
|
|
None
|
Returns:
| Type | Description |
|---|---|
Tensor
|
|
gaussian_stripe
gaussian_stripe(shape, sigma, angle=0.0, *, dtype=None, device=None)
Anisotropic Gaussian stripe filter of Section III-B.
k(r₁, r₂) = exp(−r₁′²/σ₁² − r₂′²/σ₂²),
r₁′ = r₁ cos θ + r₂ sin θ, r₂′ = −r₁ sin θ + r₂ cos θ,
with r₁ the first and r₂ the second frame axis, both centred on the
kernel centre (h // 2, w // 2). θ = 0 and σ₂ > σ₁ give stripes
along the second axis, σ₁ > σ₂ stripes along the first. The peak
value is 1, as in the formula of the paper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
(int, int)
|
Kernel shape (at most the frame shape). |
required |
sigma
|
(float, float)
|
Widths (σ₁, σ₂) > 0, in pixels. |
required |
angle
|
float
|
Orientation θ, in degrees. |
0
|
dtype
|
optional
|
|
None
|
device
|
optional
|
|
None
|
Returns:
| Type | Description |
|---|---|
Tensor
|
|