NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
nc::filter Namespace Reference

Namespaces

namespace  boundary
 

Enumerations

enum class  Boundary {
  REFLECT = 0 , CONSTANT , NEAREST , MIRROR ,
  WRAP
}
 Boundary condition to apply to the image filter. More...
 

Functions

template<typename dtype >
NdArray< double > complementaryMeanFilter (const NdArray< dtype > &inImageArray, uint32 inSize, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< double > complementaryMeanFilter1d (const NdArray< dtype > &inImageArray, uint32 inSize, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > complementaryMedianFilter (const NdArray< dtype > &inImageArray, uint32 inSize, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > complementaryMedianFilter1d (const NdArray< dtype > &inImageArray, uint32 inSize, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > convolve (const NdArray< dtype > &inImageArray, uint32 inSize, const NdArray< dtype > &inWeights, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > convolve1d (const NdArray< dtype > &inImageArray, const NdArray< dtype > &inWeights, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > gaussianFilter (const NdArray< dtype > &inImageArray, double inSigma, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > gaussianFilter1d (const NdArray< dtype > &inImageArray, double inSigma, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > laplace (const NdArray< dtype > &inImageArray, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > maximumFilter (const NdArray< dtype > &inImageArray, uint32 inSize, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > maximumFilter1d (const NdArray< dtype > &inImageArray, uint32 inSize, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< double > meanFilter (const NdArray< dtype > &inImageArray, uint32 inSize, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< double > meanFilter1d (const NdArray< dtype > &inImageArray, uint32 inSize, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > medianFilter (const NdArray< dtype > &inImageArray, uint32 inSize, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > medianFilter1d (const NdArray< dtype > &inImageArray, uint32 inSize, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > minimumFilter (const NdArray< dtype > &inImageArray, uint32 inSize, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > minumumFilter1d (const NdArray< dtype > &inImageArray, uint32 inSize, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > percentileFilter (const NdArray< dtype > &inImageArray, uint32 inSize, double inPercentile, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > percentileFilter1d (const NdArray< dtype > &inImageArray, uint32 inSize, double inPercentile, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > rankFilter (const NdArray< dtype > &inImageArray, uint32 inSize, uint32 inRank, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > rankFilter1d (const NdArray< dtype > &inImageArray, uint32 inSize, uint8 inRank, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > uniformFilter (const NdArray< dtype > &inImageArray, uint32 inSize, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 
template<typename dtype >
NdArray< dtype > uniformFilter1d (const NdArray< dtype > &inImageArray, uint32 inSize, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
 

Enumeration Type Documentation

◆ Boundary

enum class nc::filter::Boundary
strong

Boundary condition to apply to the image filter.

Enumerator
REFLECT 
CONSTANT 
NEAREST 
MIRROR 
WRAP 

Function Documentation

◆ complementaryMeanFilter()

template<typename dtype >
NdArray< double > nc::filter::complementaryMeanFilter ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a multidimensional complemenatry mean filter.

Parameters
inImageArray
inSizesquare size of the kernel to apply
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ complementaryMeanFilter1d()

template<typename dtype >
NdArray< double > nc::filter::complementaryMeanFilter1d ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculate a one-dimensional complemenatry mean filter.

Parameters
inImageArray
inSizesquare size of the kernel to apply
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ complementaryMedianFilter()

template<typename dtype >
NdArray< dtype > nc::filter::complementaryMedianFilter ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a multidimensional complemenatry median filter.

Parameters
inImageArray
inSizesquare size of the kernel to apply
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ complementaryMedianFilter1d()

template<typename dtype >
NdArray< dtype > nc::filter::complementaryMedianFilter1d ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculate a one-dimensional complemenatry median filter.

Parameters
inImageArray
inSizesquare size of the kernel to apply
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ convolve()

template<typename dtype >
NdArray< dtype > nc::filter::convolve ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
const NdArray< dtype > &  inWeights,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a multidimensional kernel convolution.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.convolve.html#scipy.ndimage.convolve

Parameters
inImageArray
inSizesquare size of the kernel to apply
inWeights
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ convolve1d()

template<typename dtype >
NdArray< dtype > nc::filter::convolve1d ( const NdArray< dtype > &  inImageArray,
const NdArray< dtype > &  inWeights,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a one-dimensional kernel convolution.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.convolve1d.html#scipy.ndimage.convolve1d

Parameters
inImageArray
inWeights
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ gaussianFilter()

template<typename dtype >
NdArray< dtype > nc::filter::gaussianFilter ( const NdArray< dtype > &  inImageArray,
double  inSigma,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a multidimensional gaussian filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.gaussian_filter.html#scipy.ndimage.gaussian_filter

Parameters
inImageArray
inSigmaStandard deviation for Gaussian kernel
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ gaussianFilter1d()

template<typename dtype >
NdArray< dtype > nc::filter::gaussianFilter1d ( const NdArray< dtype > &  inImageArray,
double  inSigma,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculate a one-dimensional gaussian filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.generic_filter1d.html#scipy.ndimage.generic_filter1d

Parameters
inImageArray
inSigmaStandard deviation for Gaussian kernel
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ laplace()

template<typename dtype >
NdArray< dtype > nc::filter::laplace ( const NdArray< dtype > &  inImageArray,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculate the 2D laplace filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.laplace.html#scipy.ndimage.laplace

Parameters
inImageArray
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ maximumFilter()

template<typename dtype >
NdArray< dtype > nc::filter::maximumFilter ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a multidimensional maximum filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.maximum_filter.html#scipy.ndimage.maximum_filter

Parameters
inImageArray
inSizesquare size of the kernel to apply
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ maximumFilter1d()

template<typename dtype >
NdArray< dtype > nc::filter::maximumFilter1d ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a one-dimensional maximum filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.maximum_filter1d.html#scipy.ndimage.maximum_filter1d

Parameters
inImageArray
inSizelinear size of the kernel to apply
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ meanFilter()

template<typename dtype >
NdArray< double > nc::filter::meanFilter ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a multidimensional mean filter.

Parameters
inImageArray
inSizesquare size of the kernel to apply
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ meanFilter1d()

template<typename dtype >
NdArray< double > nc::filter::meanFilter1d ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a one-dimensional mean filter.

Parameters
inImageArray
inSizelinear size of the kernel to apply
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ medianFilter()

template<typename dtype >
NdArray< dtype > nc::filter::medianFilter ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a multidimensional median filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.median_filter.html#scipy.ndimage.median_filter

Parameters
inImageArray
inSizesquare size of the kernel to apply
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ medianFilter1d()

template<typename dtype >
NdArray< dtype > nc::filter::medianFilter1d ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a one-dimensional median filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.median_filter.html#scipy.ndimage.median_filter

Parameters
inImageArray
inSizelinear size of the kernel to apply
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ minimumFilter()

template<typename dtype >
NdArray< dtype > nc::filter::minimumFilter ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a multidimensional minimum filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.minimum_filter.html#scipy.ndimage.minimum_filter

Parameters
inImageArray
inSizesquare size of the kernel to apply
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ minumumFilter1d()

template<typename dtype >
NdArray< dtype > nc::filter::minumumFilter1d ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a one-dimensional minumum filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.minimum_filter1d.html#scipy.ndimage.minimum_filter1d

Parameters
inImageArray
inSizelinear size of the kernel to apply
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ percentileFilter()

template<typename dtype >
NdArray< dtype > nc::filter::percentileFilter ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
double  inPercentile,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a multidimensional percentile filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.percentile_filter.html#scipy.ndimage.percentile_filter

Parameters
inImageArray
inSizesquare size of the kernel to apply
inPercentilepercentile [0, 100]
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ percentileFilter1d()

template<typename dtype >
NdArray< dtype > nc::filter::percentileFilter1d ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
double  inPercentile,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a one-dimensional percentile filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.percentile_filter.html#scipy.ndimage.percentile_filter

Parameters
inImageArray
inSizelinear size of the kernel to apply
inPercentilepercentile [0, 100]
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ rankFilter()

template<typename dtype >
NdArray< dtype > nc::filter::rankFilter ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
uint32  inRank,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a multidimensional rank filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.rank_filter.html#scipy.ndimage.rank_filter

Parameters
inImageArray
inSizesquare size of the kernel to apply
inRank([0, inSize^2 - 1])
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ rankFilter1d()

template<typename dtype >
NdArray< dtype > nc::filter::rankFilter1d ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
uint8  inRank,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a one-dimensional rank filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.rank_filter.html#scipy.ndimage.rank_filter

Parameters
inImageArray
inSizelinear size of the kernel to apply
inRank([0, inSize^2 - 1])
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ uniformFilter()

template<typename dtype >
NdArray< dtype > nc::filter::uniformFilter ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a multidimensional uniform filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.uniform_filter.html#scipy.ndimage.uniform_filter

Parameters
inImageArray
inSizesquare size of the kernel to apply
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray

◆ uniformFilter1d()

template<typename dtype >
NdArray< dtype > nc::filter::uniformFilter1d ( const NdArray< dtype > &  inImageArray,
uint32  inSize,
Boundary  inBoundaryType = Boundary::REFLECT,
dtype  inConstantValue = 0 
)

Calculates a one-dimensional uniform filter.

SciPy Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.uniform_filter1d.html#scipy.ndimage.uniform_filter1d

Parameters
inImageArray
inSizelinear size of the kernel to apply
inBoundaryTypeboundary mode (default Reflect) options (reflect, constant, nearest, mirror, wrap)
inConstantValuecontant value if boundary = 'constant' (default 0)
Returns
NdArray