Linear Methods for Image Interpolation
Data Structures | Functions
lprefilt.c File Reference

Prefiltering for linear interpolation. More...

#include <stdlib.h>
#include <math.h>
#include <fftw3.h>
#include "adaptlob.h"
#include "lprefilt.h"
Include dependency graph for lprefilt.c:

Go to the source code of this file.

Data Structures

struct  convolutionparams

Functions

void PrefilterImage (float *Data, int Width, int Height, int NumChannels, const float *alpha, int NumFilterPairs, float ConstantFactor, boundaryhandling Boundary)
 Apply a cascade of first-order recursive filter pairs to an image.
void PsfConvCoeff (float *Coeff, int NumCoeffs, float(*Psf)(float, const void *), const void *PsfParams, float(*Kernel)(float), float KernelRadius, int KernelNormalize)
 Compute PSF*kernel convolution coefficients.
int PsfPreFilter (float *Data, int Width, int Height, int NumChannels, const float *Coeff, int NumCoeffs, boundaryhandling Boundary)
 Prefiltering to adjust interpolation for PSF.

Detailed Description

Prefiltering for linear interpolation.

Author:
Pascal Getreuer <getreuer@gmail.com>

This file implements the prefiltering PrefilterImage on the input image needed before performing interpolation needed with B-splines and o-Moms. Also implemented here is PsfPreFilter, the prefiltering adjustment needed when interpolating with a PSF.

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 lprefilt.c.


Function Documentation

void PrefilterImage ( float *  Data,
int  Width,
int  Height,
int  NumChannels,
const float *  alpha,
int  NumFilterPairs,
float  ConstantFactor,
boundaryhandling  Boundary 
)

Apply a cascade of first-order recursive filter pairs to an image.

Parameters:
Datathe image data
Width,Height,NumChannelsimage dimensions
alphaarray of alpha values
NumFilterPairsthe number of filter pairs
ConstantFactorconstant multiplicative factor to apply
Boundarythe kind of boundary handling to use

Definition at line 132 of file lprefilt.c.

Here is the caller graph for this function:

void PsfConvCoeff ( float *  Coeff,
int  NumCoeffs,
float(*)(float, const void *)  Psf,
const void *  PsfParams,
float(*)(float)  Kernel,
float  KernelRadius,
int  KernelNormalize 
)

Compute PSF*kernel convolution coefficients.

Parameters:
Coeffpointer to coefficients destination array
NumCoeffsnumber of coefficients to compute
Psfthe point-spread function (PSF)
PsfParamsparameters to pass to Psf
Kernelthe interpolation kernel or basis function to use
KernelRadiussupport radius of Kernel
KernelNormalizeif nonzero, Kernel is normalized to sum to 1

The coefficients are the convolution Coeff[m] = (Psf * Kernel)(m) for m = 0, ..., NumCoeffs - 1. Integration is approximated using adaptive Gauss-Lobatto quadrature.

The result of this routine is used by PsfPreFilter.

Definition at line 214 of file lprefilt.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int PsfPreFilter ( float *  Data,
int  Width,
int  Height,
int  NumChannels,
const float *  Coeff,
int  NumCoeffs,
boundaryhandling  Boundary 
)

Prefiltering to adjust interpolation for PSF.

Parameters:
Datapointer to image data to be filtered
Width,Height,NumChannelsimage dimensions
Coeffthe PSF adjustment coefficients from PsfConvCoeff
NumCoeffsnumber of coefficients
Boundaryboundary handling

Convolves Data with the inverse of Coeff[0] + Coeff[1] (z + z^-1) + Coeff[2] (z^2 + z^-2) + ... via the DCT transform. Boundary handling can be either half- or whole- sample symmetric (constant extension is not supported).

Half-sample symmetric boundary handling is considerably more efficient, about 25% shorter runtime than when using whole-sample symmetry.

Definition at line 380 of file lprefilt.c.

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines