bregman_utils.q

Contains some general routines that are often used in Bregman/Primal Dual iterative algorithms.  These algorithms solve non-linear inverse problems that are encountered within the field of image reconstruction and restoration.

Summary
bregman_utils.qContains some general routines that are often used in Bregman/Primal Dual iterative algorithms.
Functions
kernelshiftHiep’s kernelshift function: pads a given filter kernel (mask) with zeros so that it has the dimensions rows x cols.
displacement_diffComputes a displacement difference.
shrinkSoft-shrinkage of a subband (or cell array)
DxHorizontal derivative operation
DyVertical derivative operation
DxtHorizontal derivative operation (adjoint operation)
DytVertical derivative operation (adjoint operation)
psnrComputation of the Peak-Signal-To-Noise (PSNR) ratio

Functions

kernelshift

Hiep’s kernelshift function: pads a given filter kernel (mask) with zeros so that it has the dimensions rows x cols.  This function is useful for implementing a convolution in the frequency domain

function result = kernelshift(kernel, rows, cols)

Parameters

kernelthe filter kernel (mask) to extend
rowsthe new number of rows
colsthe new number of cols

displacement_diff

Computes a displacement difference.  Useful for implementing discrete derivatives, such as used in Total Variation (TV) approaches.  The function uses circular boundary extension.

function y = displacement_diff(x, d)

Parameters

xinput matrix/cube to add displacement
ddisplacement vector

Returns

yThe displaced difference, according to the relationship
y[p] = x[p] - x[p+d]

See also

circshift

shrink

Soft-shrinkage of a subband (or cell array)

function y = shrink(x, T)

The function performs soft-shrinkage, according to the formula y = sign(x)*max(abs(x)-T,0)

Parameters

xinput data.  Can be “cell”, “scalar” or “cube”
Tthreshold

Notes

Only real-valued data is accepted.

Dx

Horizontal derivative operation

function y = Dx(x)

See also

Dxt

Dy

Vertical derivative operation

function y = Dy(x)

See also

Dyt

Dxt

Horizontal derivative operation (adjoint operation)

function y = Dxt(x)

See also

Dx

Dyt

Vertical derivative operation (adjoint operation)

function y = Dyt(x)

See also

Dy

psnr

Computation of the Peak-Signal-To-Noise (PSNR) ratio

psnr = (x, y) -> 10*log10(255^2/mean((x-y).^2))
Applies circular (periodic) shifting of a given vector, according to the relationship y[p] = x[p+d]
Horizontal derivative operation (adjoint operation)
Vertical derivative operation (adjoint operation)
Horizontal derivative operation
Vertical derivative operation
Close