Total Variation Deconvolution using Split Bregman
|
Convolution functions. More...
Go to the source code of this file.
Macros | |
#define | CLAMP(X, A, B) (((X) < (A)) ? (A) : (((X) > (B)) ? (B) : (X))) |
Clamp X to [A, B]. | |
Functions | |
void | SampledConv1D (float *Dest, int DestStride, const float *Src, int SrcStride, filter Filter, boundaryext Boundary, int N, int nStart, int nStep, int nEnd) |
(Sub)sampled 1D FIR convolution More... | |
void | SeparableConv2D (float *Dest, float *Buffer, const float *Src, filter FilterX, filter FilterY, boundaryext Boundary, int Width, int Height, int NumChannels) |
Separable 2D FIR convolution with constant boundary extension. More... | |
filter | MakeFilter (float *Coeff, int Delay, int Length) |
Make a filter. | |
filter | AllocFilter (int Delay, int Length) |
Allocate memory for a 1D FIR filter with length Length. | |
int | IsNullFilter (filter Filter) |
Tests whether a filter is NULL. | |
filter | GaussianFilter (double Sigma, int R) |
Construct an FIR approximation of a Gaussian filter. More... | |
static float | ZeroPaddedExtension (const float *Src, int Stride, int N, int n) |
static float | ConstantExtension (const float *Src, int Stride, int N, int n) |
static float | LinearExtension (const float *Src, int Stride, int N, int n) |
static float | PeriodicExtension (const float *Src, int Stride, int N, int n) |
static float | SymhExtension (const float *Src, int Stride, int N, int n) |
static float | SymwExtension (const float *Src, int Stride, int N, int n) |
static float | AsymhExtension (const float *Src, int Stride, int N, int n) |
static float | AsymwExtension (const float *Src, int Stride, int N, int n) |
boundaryext | GetBoundaryExt (const char *Boundary) |
Get function pointer to boundary extension function. More... | |
Variables | |
const filter | NullFilter = {NULL, 0, 0} |
NULL filter object. | |
Convolution functions.
Copyright (c) 2010-2011, 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 conv.c.
filter GaussianFilter | ( | double | Sigma, |
int | R | ||
) |
Construct an FIR approximation of a Gaussian filter.
Sigma | standard deviation of the Gaussian filter |
R | support radius |
This function returns an FIR filter approximating a Gaussian with standard deviation Sigma. It is the responsibility of the caller to call FreeFilter to free the filter coefficients memory when done.
The support radius of the filter is R, and the filter length is 2*R + 1. A reasonable choice for R is R = (int)ceil(4*Sigma). The coefficients are normalized to have unit sum. If Sigma is zero, then the unit impulse filter is returned.
boundaryext GetBoundaryExt | ( | const char * | Boundary | ) |
Get function pointer to boundary extension function.
Boundary | string naming the boundary extension |
Choices for Boundary are
void SampledConv1D | ( | float * | Dest, |
int | DestStride, | ||
const float * | Src, | ||
int | SrcStride, | ||
filter | Filter, | ||
boundaryext | Boundary, | ||
int | N, | ||
int | nStart, | ||
int | nStep, | ||
int | nEnd | ||
) |
(Sub)sampled 1D FIR convolution
Dest | pointer to memory to hold the result |
DestStride | step between successive output samples |
Src | pointer to the input data |
SrcStride | step between successive input samples |
Filter | the filter |
Boundary | boundary extension |
N | the length of the convolution |
nStart,nStep,nEnd | sample the convolution at nStart:nStep:nEnd |
void SeparableConv2D | ( | float * | Dest, |
float * | Buffer, | ||
const float * | Src, | ||
filter | FilterX, | ||
filter | FilterY, | ||
boundaryext | Boundary, | ||
int | Width, | ||
int | Height, | ||
int | NumChannels | ||
) |
Separable 2D FIR convolution with constant boundary extension.
Dest | pointer to memory to hold the result |
Buffer | workspace buffer of size Width*Height |
Src | pointer to the input image in row-major planar order |
FilterX | the horizontal filter |
FilterY | the vertical filter |
Boundary | boundary extension |
Width | image width |
Height | image height |
NumChannels | number of image channels |