gpufilter
GPU-Efficient Recursive Filtering and Summed-Area Tables
API for CPU functions

Modules

 CPU Computation functions

Functions

template<class T >
void gpufilter::extend_image (T *&ext_img, int &ext_w, int &ext_h, const T *img, const int &w, const int &h, const int &extb, const initcond &ic)
 Extend an image to consider initial condition outside.
template<class T >
void gpufilter::extract_image (T *img, const int &w, const int &h, T *&ext_img, const int &ext_w, const int &extb)
 Extract an image from an extended image.
template<class T >
void gpufilter::sat_cpu (T *in, const int &w, const int &h)
 Compute the Summed-area Table of an image in the CPU.
template<class T >
void gpufilter::gaussian_cpu (T **in, const int &w, const int &h, const int &depth, const T &s, const int &extb=1, const initcond &ic=clamp)
 Gaussian blur an image in the CPU.
template<class T >
void gpufilter::gaussian_cpu (T *in, const int &w, const int &h, const T &s, const int &extb=1, const initcond &ic=clamp)
 Gaussian blur a single-channel image in the CPU.
template<class T >
void gpufilter::bspline3i_cpu (T **in, const int &w, const int &h, const int &depth, const int &extb=1, const initcond &ic=mirror)
 Compute the Bicubic B-Spline interpolation of an image in the CPU.
template<class T >
void gpufilter::bspline3i_cpu (T *in, const int &w, const int &h, const int &extb=1, const initcond &ic=mirror)
 Compute the Bicubic B-Spline interpolation of a single-channel image in the CPU.

Function Documentation

template<class T >
void gpufilter::bspline3i_cpu ( T **  in,
const int &  w,
const int &  h,
const int &  depth,
const int &  extb = 1,
const initcond &  ic = mirror 
)

Compute the Bicubic B-Spline interpolation of an image in the CPU.

Given an input 2D image compute the Bicubic B-Spline interpolation of it by applying a first-order recursive filter using clamp-to-border initial conditions.

Parameters:
[in,out]inThe 2D image to compute the Bicubic B-Spline interpolation
[in]wWidth of the input image
[in]hHeight of the input image
[in]depthDepth of the input image (color channels)
[in]extbExtension (in blocks) to consider outside image (default 1)
[in]icInitial condition (for outside access) (default mirror)
Template Parameters:
TImage value type
Examples:
app_recursive.cc, and example_bspline.cc.
template<class T >
void gpufilter::bspline3i_cpu ( T *  in,
const int &  w,
const int &  h,
const int &  extb = 1,
const initcond &  ic = mirror 
)

Compute the Bicubic B-Spline interpolation of a single-channel image in the CPU.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
[in,out]inThe single-channel 2D image to compute the Bicubic B-Spline interpolation
[in]wWidth of the input image
[in]hHeight of the input image
[in]extbExtension (in blocks) to consider outside image (default 1)
[in]icInitial condition (for outside access) (default mirror)
Template Parameters:
TImage value type
template<class T >
void gpufilter::extend_image ( T *&  ext_img,
int &  ext_w,
int &  ext_h,
const T *  img,
const int &  w,
const int &  h,
const int &  extb,
const initcond &  ic 
)

Extend an image to consider initial condition outside.

Given an input 2D image extend it including a given initial condition for outside access.

Parameters:
[out]ext_imgThe extended 2D image (to be allocated)
[out]ext_wWidth of the extended image
[out]ext_hHeight of the extended image
[in]imgThe 2D image to extend
[in]wWidth of the input image
[in]hHeight of the input image
[in]extbExtension (in blocks) to consider outside image
[in]icInitial condition (for outside access)
Template Parameters:
TImage value type
Examples:
example_bspline.cc.
template<class T >
void gpufilter::extract_image ( T *  img,
const int &  w,
const int &  h,
T *&  ext_img,
const int &  ext_w,
const int &  extb 
)

Extract an image from an extended image.

Given an input 2D extended image (with initial conditions) extract the original image in the middle.

Parameters:
[out]imgThe 2D image to extract
[in]wWidth of the extracted image
[in]hHeight of the extracted image
[in,out]ext_imgThe extended 2D image (to be deallocated)
[in]ext_wWidth of the extended image
[in]extbExtension (in blocks) considered in extended image
Template Parameters:
TImage value type
Examples:
example_bspline.cc.
template<class T >
void gpufilter::gaussian_cpu ( T **  in,
const int &  w,
const int &  h,
const int &  depth,
const T &  s,
const int &  extb = 1,
const initcond &  ic = clamp 
)

Gaussian blur an image in the CPU.

Given an input 2D image compute the Gaussian blur of it by applying a sequence of recursive filters using clamp-to-border initial conditions.

Parameters:
[in,out]inThe 2D image to compute Gaussian blur
[in]wWidth of the input image
[in]hHeight of the input image
[in]depthDepth of the input image (color channels)
[in]sSigma support of Gaussian blur computation
[in]extbExtension (in blocks) to consider outside image (default 1)
[in]icInitial condition (for outside access) (default clamp)
Template Parameters:
TImage value type
Examples:
app_recursive.cc, and example_gauss.cc.
template<class T >
void gpufilter::gaussian_cpu ( T *  in,
const int &  w,
const int &  h,
const T &  s,
const int &  extb = 1,
const initcond &  ic = clamp 
)

Gaussian blur a single-channel image in the CPU.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
[in,out]inThe single-channel 2D image to compute Gaussian blur
[in]wWidth of the input image
[in]hHeight of the input image
[in]sSigma support of Gaussian blur computation
[in]extbExtension (in blocks) to consider outside image (default 1)
[in]icInitial condition (for outside access) (default clamp)
Template Parameters:
TImage value type
template<class T >
void gpufilter::sat_cpu ( T *  in,
const int &  w,
const int &  h 
)

Compute the Summed-area Table of an image in the CPU.

Given an input 2D image compute its Summed-Area Table (SAT) by applying a first-order recursive filters forward using zero-border initial conditions.

Parameters:
[in,out]inThe 2D image to compute the SAT
[in]wWidth of the input image
[in]hHeight of the input image
Template Parameters:
TImage value type
Examples:
example_sat1.cc, example_sat2.cc, and example_sat3.cc.