ImFusion SDK 4.3
ImFusion::Filters Namespace Reference

Set of functions for efficient filtering on CPU. More...

Detailed Description

Set of functions for efficient filtering on CPU.

Functions

template<typename T>
void boxFilter2d (const T *in, T *out, int width, int height, int channels, int nbSizes, int *filterSizesX, int *filterSizesY)
 Generic function to apply a box filter on a 2D image with different sizes.
 
template<typename T>
void boxFilter2d (const T *in, T *out, int width, int height, int channels, int filterSizeX, int filterSizeY)
 Helper function for a single filter pass.
 
template<typename T>
void boxFilter2d (const TypedImage< T > *in, TypedImage< T > *out, int filterSizeX, int filterSizeY)
 Helper function for a single filter pass with a typed image.
 
void boxFilter2d (const MemImage *in, MemImage *out, int filterSizeX, int filterSizeY)
 
template<typename T>
void boxFilter3d (const T *in, T *out, int width, int height, int slices, int channels, int nbSizes, int *filterSizesX, int *filterSizesY, int *filterSizesZ)
 Generic function to apply a box filter on a 3D image with different sizes.
 
template<typename T>
void boxFilter3d (const T *in, T *out, int width, int height, int slices, int channels, int filterSizeX, int filterSizeY, int filterSizeZ)
 Helper function for a single filter pass.
 
template<typename T>
void boxFilter3d (const TypedImage< T > *in, TypedImage< T > *out, int filterSizeX, int filterSizeY, int filterSizeZ)
 Helper function for a single filter pass with a typed image.
 
void boxFilter3d (const MemImage *in, MemImage *out, int filterSizeX, int filterSizeY, int filterSizeZ)
 
template<typename T>
void gaussFilter2d (const T *in, T *out, int width, int height, int channels, int filterSize, int nPasses=3)
 Fast approximation of a gaussian filter via a series of box filters.
 
void gaussFilter3d (const float *in, float *out, int width, int height, int slices, int channels, int filterSize, int nPasses=3)
 Fast approximation of a gaussian filter via a series of box filters.
 
void laplacianFilter2d (const float *in, float *out, int width, int height, int filterSize)
 Computation of a 2D laplacian filter at a given scale.
 
void laplacianFilter3d (const float *in, float *out, int width, int height, int slices, int filterSize)
 Computation of a 3D laplacian filter at a given scale.
 
void guidedFilter2d (const float *in, const float *guide, float *out, int width, int height, int channels, int filterSizeX, int filterSizeY, float epsilon, bool useGaussFilter=false)
 Guided filter using box or gaussian filter.
 
template<typename T>
void guidedFilter2d (const TypedImage< T > *in, const TypedImage< T > *guide, TypedImage< T > *out, int filterSizeX, int filterSizeY, float epsilon, bool useGaussFilter=false)
 Helper function for a guided filter with a typed image.
 
void guidedFilter2d (const MemImage *in, const MemImage *guide, MemImage *out, int filterSizeX, int filterSizeY, float epsilon, bool useGaussFilter=false)
 
void guidedFilter2d (const float *in, float *out, int width, int height, int channels, int filterSizeX, int filterSizeY, float epsilon, bool useGaussFilter=false)
 Guided filter using box or gaussian filter.
 
void guidedFilter3d (const float *in, const float *guide, float *out, int width, int height, int slices, int channels, int filterSizeX, int filterSizeY, int filterSizeZ, float epsilon, bool useGaussFilter=false)
 Guided filter using box or gaussian filter.
 
template<typename T>
void guidedFilter3d (const TypedImage< T > *in, const TypedImage< T > *guide, TypedImage< T > *out, int filterSizeX, int filterSizeY, int filterSizeZ, float epsilon, bool useGaussFilter=false)
 Helper function for a guided filter with a typed image.
 
void guidedFilter3d (const MemImage *in, const MemImage *guide, MemImage *out, int filterSizeX, int filterSizeY, int filterSizeZ, float epsilon, bool useGaussFilter=false)
 
void guidedFilter3d (const float *in, float *out, int width, int height, int slices, int channels, int filterSizeX, int filterSizeY, int filterSizeZ, float epsilon, bool useGaussFilter=false)
 Guided filter using box or gaussian filter.
 
template<typename T>
void unsharpMaskFilter2d (const T *in, T *out, int width, int height, int filterSize, double k, double threshold=0.0, double thresholdSigma=0.0, bool clamp=true)
 Unsharp mask filter.
 
bool grayscaleADSOCFilter2d (const TypedImage< float > *in, TypedImage< float > *&out, double textureThreshold=0.0, double edgeThreshold=0.0, double gain=1.0, double overshootControl=0.5, bool decreaseMinima=false, bool useOrthogonalMatrices=false)
 
bool edgeFilter2D (const TypedImage< float > &in, TypedImage< float > *&out)
 

Function Documentation

◆ boxFilter2d()

template<typename T>
void boxFilter2d ( const T * in,
T * out,
int width,
int height,
int channels,
int nbSizes,
int * filterSizesX,
int * filterSizesY )

Generic function to apply a box filter on a 2D image with different sizes.

Implementation is separable and independent of the kernel size Boundary conditions: values are repeated outside the image

◆ boxFilter3d()

template<typename T>
void boxFilter3d ( const T * in,
T * out,
int width,
int height,
int slices,
int channels,
int nbSizes,
int * filterSizesX,
int * filterSizesY,
int * filterSizesZ )

Generic function to apply a box filter on a 3D image with different sizes.

Implementation is separable and independent of the kernel size Boundary conditions: values are repeated outside the image

◆ gaussFilter2d()

template<typename T>
void gaussFilter2d ( const T * in,
T * out,
int width,
int height,
int channels,
int filterSize,
int nPasses = 3 )

Fast approximation of a gaussian filter via a series of box filters.

The more passes, the closer to a Gaussian the filter is (3 passes already yields less than 10% error) See http://web.csse.uwa.edu.au/research/?a=826172 (but not using the integral images)

Deprecated
"Use GaussianFilter class instead."

◆ gaussFilter3d()

void gaussFilter3d ( const float * in,
float * out,
int width,
int height,
int slices,
int channels,
int filterSize,
int nPasses = 3 )

Fast approximation of a gaussian filter via a series of box filters.

The more passes, the closer to a Gaussian the filter is (3 passes already yields less than 10% error) See http://web.csse.uwa.edu.au/research/?a=826172 (but not using the integral images)

Deprecated
"Use GaussianFilter class instead."

◆ guidedFilter2d() [1/2]

void guidedFilter2d ( const float * in,
const float * guide,
float * out,
int width,
int height,
int channels,
int filterSizeX,
int filterSizeY,
float epsilon,
bool useGaussFilter = false )

Guided filter using box or gaussian filter.

See the paper by He et al. http://research.microsoft.com/en-us/um/people/jiansun/papers/GuidedFilter_ECCV10.pdf Warning: the different channels are filtered independently, which is not optimal

◆ guidedFilter2d() [2/2]

void guidedFilter2d ( const float * in,
float * out,
int width,
int height,
int channels,
int filterSizeX,
int filterSizeY,
float epsilon,
bool useGaussFilter = false )

Guided filter using box or gaussian filter.

Optimized version for the special case when in == guide

◆ guidedFilter3d() [1/2]

void guidedFilter3d ( const float * in,
const float * guide,
float * out,
int width,
int height,
int slices,
int channels,
int filterSizeX,
int filterSizeY,
int filterSizeZ,
float epsilon,
bool useGaussFilter = false )

Guided filter using box or gaussian filter.

See the paper by He et al. http://research.microsoft.com/en-us/um/people/jiansun/papers/GuidedFilter_ECCV10.pdf Warning: the different channels are filtered independently, which is not optimal

◆ guidedFilter3d() [2/2]

void guidedFilter3d ( const float * in,
float * out,
int width,
int height,
int slices,
int channels,
int filterSizeX,
int filterSizeY,
int filterSizeZ,
float epsilon,
bool useGaussFilter = false )

Guided filter using box or gaussian filter.

Optimized version for the special case when in == guide

◆ unsharpMaskFilter2d()

template<typename T>
void unsharpMaskFilter2d ( const T * in,
T * out,
int width,
int height,
int filterSize,
double k,
double threshold = 0.0,
double thresholdSigma = 0.0,
bool clamp = true )

Unsharp mask filter.

Sharpens image by subtracting a blurred version of the image from the original, i.e. Sharpened = Original + ( Original - Blurred ) * Amount. Input image and output image must have same size. Only single channel images with no padding are supported.

\param in Pointer to input pixel data
\param out pointer to output pixel data. Must be different from input data.
\param width Width of input and output image
\param height Height of input and output image
\param filterSize Kernel size of the blurring kernel. Even kernel sizes will be internally increased by one.
\param k Amount of sharpening
\param threshold Minimum difference between the original pixel and the blurred pixel to apply the subtraction.
Search Tab / S to search, Esc to close