Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub
Recursive Bilateral Filters

Recursive bilateral image filters. More...

Enumerations

enum  SimdRecursiveBilateralFilterFlags {
  SimdRecursiveBilateralFilterFast = 0 ,
  SimdRecursiveBilateralFilterPrecise = 1 ,
  SimdRecursiveBilateralFilterDiffAvg = 0 ,
  SimdRecursiveBilateralFilterDiffMax = 2 ,
  SimdRecursiveBilateralFilterDiffSum = 4 ,
  SimdRecursiveBilateralFilterDiffMask = 6 ,
  SimdRecursiveBilateralFilterFmaAvoid = 8
}
 

Functions

SIMD_API void * SimdRecursiveBilateralFilterInit (size_t width, size_t height, size_t channels, const float *sigmaSpatial, const float *sigmaRange, SimdRecursiveBilateralFilterFlags flags)
 Creates Recursive bilateral filter context. More...
 
SIMD_API void SimdRecursiveBilateralFilterRun (const void *filter, const uint8_t *src, size_t srcStride, uint8_t *dst, size_t dstStride)
 Performs image recursive bilateral filtering. More...
 
template<template< class > class A>
SIMD_INLINE void RecursiveBilateralFilter (const View< A > &src, View< A > &dst, float sigmaSpatial, float sigmaRange, SimdRecursiveBilateralFilterFlags flags=SimdRecursiveBilateralFilterFast)
 Performs image recursive bilateral filtering. More...
 

Detailed Description

Recursive bilateral image filters.

Enumeration Type Documentation

◆ SimdRecursiveBilateralFilterFlags

Describes Recursive Bilateral Filter flags. This type used in function SimdRecursiveBilateralFilterInit.

Enumerator
SimdRecursiveBilateralFilterFast 

Fast implementation of Recursive Bilateral Filter.

SimdRecursiveBilateralFilterPrecise 

Precise implementation of Recursive Bilateral Filter.

SimdRecursiveBilateralFilterDiffAvg 

Use averaging to estimate result color difference.

SimdRecursiveBilateralFilterDiffMax 

Use channel difference maximum to estimate result color difference.

SimdRecursiveBilateralFilterDiffSum 

Use saturated sum to estimate result color difference.

SimdRecursiveBilateralFilterDiffMask 

Color difference type mask.

SimdRecursiveBilateralFilterFmaAvoid 

Not use FMA instructions (for debug purposes).

Function Documentation

◆ SimdRecursiveBilateralFilterInit()

void * SimdRecursiveBilateralFilterInit ( size_t  width,
size_t  height,
size_t  channels,
const float *  sigmaSpatial,
const float *  sigmaRange,
SimdRecursiveBilateralFilterFlags  flags 
)

Creates Recursive bilateral filter context.

An using example:

float sigmaSpatial = 0.2f, sigmaRange = 0.2f;
void* filter = SimdRecursiveBilateralFilterInit(width, height, channels, &sigmaSpatial, &sigmaRange, SimdRecursiveBilateralFilterFast);
if (filter)
{
     SimdRecursiveBilateralFilterRun(filter, src, srcStride, dst, dstStride);
     SimdRelease(filter);
}
Parameters
[in]width- a width of input and output image.
[in]height- a height of input and output image.
[in]channels- a channel number of input and output image. Its value must be in range [1..4].
[in]sigmaSpatial- a pointer to sigma spatial parameter.
[in]sigmaRange- a pointer to sigma range parameter.
[in]flags- a flags of algorithm parameters.
Returns
a pointer to filter context. On error it returns NULL. This pointer is used in functions SimdRecursiveBilateralFilterRun. It must be released with using of function SimdRelease.

◆ SimdRecursiveBilateralFilterRun()

void SimdRecursiveBilateralFilterRun ( const void *  filter,
const uint8_t *  src,
size_t  srcStride,
uint8_t *  dst,
size_t  dstStride 
)

Performs image recursive bilateral filtering.

Parameters
[in]filter- a filter context. It must be created by function SimdRecursiveBilateralFilterInit and released by function SimdRelease.
[in]src- a pointer to pixels data of the original input image.
[in]srcStride- a row size (in bytes) of the input image.
[out]dst- a pointer to pixels data of the filtered output image.
[in]dstStride- a row size (in bytes) of the output image.

◆ RecursiveBilateralFilter()

void RecursiveBilateralFilter ( const View< A > &  src,
View< A > &  dst,
float  sigmaSpatial,
float  sigmaRange,
SimdRecursiveBilateralFilterFlags  flags = SimdRecursiveBilateralFilterFast 
)

Performs image recursive bilateral filtering.

All images must have the same width, height and pixel format.

Note
This function is a C++ wrapper for functionû SimdRecursiveBilateralFilterInit and SimdRecursiveBilateralFilterRun.
Parameters
[in]src- an original input image.
[out]dst- a filtered output image.
[in]sigmaSpatial- a sigma spatial parameter.
[in]sigmaRange- a sigma range parameter.
[in]flags- a flags of algorithm parameters. By default it is equal to SimdRecursiveBilateralFilterFast.