Total Variation Deconvolution using Split Bregman
Functions
util_deconv.h File Reference

Utility routines used in both DCT and DFT based deconvolution. More...

#include "tvregopt.h"

Go to the source code of this file.

Functions

static void Divergence (num *DivV, int DivWidth, int DivHeight, const numvec2 *V, int Width, int Height, int NumChannels)
 Compute discrete 2D divergence. More...
 
static num UUpdate (tvregsolver *S)
 Trims padding, computes ||B - u||, and assigns u = B. More...
 
static ATTRIBUTE_ALWAYSINLINE int WSymExtension (int N, int i)
 Boundary handling function for whole-sample symmetric extension. More...
 
static ATTRIBUTE_ALWAYSINLINE int PeriodicExtension (int N, int i)
 Boundary handling function for periodic extension. More...
 

Detailed Description

Utility routines used in both DCT and DFT based deconvolution.

Author
Pascal Getreuer getre.nosp@m.uer@.nosp@m.gmail.nosp@m..com

Copyright (c) 2010-2012, Pascal Getreuer All rights reserved.

This program is free software: you can use, modify and/or redistribute it under the terms of the simplified BSD License. You should have received a copy of this license along this program. If not, see http://www.opensource.org/licenses/bsd-license.html.

Definition in file util_deconv.h.

Function Documentation

static void Divergence ( num *  DivV,
int  DivWidth,
int  DivHeight,
const numvec2 V,
int  Width,
int  Height,
int  NumChannels 
)
static

Compute discrete 2D divergence.

Parameters
DivVthe divergence of V
DivWidth,DivHeightthe dimensions of DivV
Vinput vector field
Width,Height,NumChannelsthe dimensions of V

The discrete divergence is defined as the negative adjoint of the discrete gradient operator, $ \operatorname{div}:=-\nabla^* =-\partial^*_x-\partial^*_y, $ where $ -\partial^* $ is

\[ \begin{pmatrix}-\partial^* g_0 \\-\partial^* g_1 \\ \vdots \\ -\partial^* g_{N-2} \\ -\partial^* g_{N-1}\end{pmatrix} = \begin{pmatrix} \hphantom{-}1 & & & & \\ -1 & 1 & & & \\ & \ddots & \ddots & & \\ & & -1 & \hphantom{-}1 & \\ & & & -1 & 0 \end{pmatrix}\begin{pmatrix} g_0 \\ g_1 \\ \vdots \\ g_{N-2} \\ g_{N-1}\end{pmatrix}. \]

In the interior of the domain, the discrete divergence reduces to backward differences,

\[ \operatorname{div}V_{i,j}=V^x_{i,j}-V^x_{i-1,j} +V^y_{i,j}-V^y_{i,j-1}, \]

for i = 1, ..., Width-2, j = 1, ..., Height-2.

The input vector field V is represented as an array of numvec2 elements,

V[i + Width*(j + Height*k)].x = x-component at pixel (i,j) channel k,
V[i + Width*(j + Height*k)].y = y-component at pixel (i,j) channel k,

where i = 0, ..., Width-1, j = 0, ..., Height-1, and k = 0, ..., NumChannels-1.

Definition at line 49 of file util_deconv.h.

static ATTRIBUTE_ALWAYSINLINE int PeriodicExtension ( int  N,
int  i 
)
static

Boundary handling function for periodic extension.

Parameters
Nis the data length
iis an index into the data
Returns
an index that is always between 0 and N - 1

Extends data "abcde" to "...deabcdeabcdeabc..."

Definition at line 158 of file util_deconv.h.

static num UUpdate ( tvregsolver S)
static

Trims padding, computes ||B - u||, and assigns u = B.

Parameters
Stvreg solver state
Returns
the norm ||B - u||

Definition at line 102 of file util_deconv.h.

static ATTRIBUTE_ALWAYSINLINE int WSymExtension ( int  N,
int  i 
)
static

Boundary handling function for whole-sample symmetric extension.

Parameters
Nis the data length
iis an index into the data
Returns
an index that is always between 0 and N - 1

Extends data "abcde" to "...cbabcdedcbabcde..."

Definition at line 136 of file util_deconv.h.