55 template<
typename dtype>
59 dtype inConstantValue = 0)
67 constexpr uint32 MIN_KERNEL_SIZE = 5;
69 std::max(
static_cast<uint32>(std::ceil(inSigma * 2. * 4.)), MIN_KERNEL_SIZE);
70 if (kernelSize % 2 == 0)
75 const auto kernalHalfSize =
static_cast<double>(kernelSize / 2);
79 for (
double row = 0; row < kernelSize; ++row)
81 for (
double col = 0; col < kernelSize; ++col)
83 kernel(
static_cast<uint32>(row),
static_cast<uint32>(col)) =
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition Error.hpp:37
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:139
value_type item() const
Definition NdArrayCore.hpp:3102
self_type sum(Axis inAxis=Axis::NONE) const
Definition NdArrayCore.hpp:4698
Definition addBoundary1d.hpp:44
NdArray< dtype > convolve(const NdArray< dtype > &inImageArray, uint32 inSize, const NdArray< dtype > &inWeights, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
Definition convolve.hpp:60
NdArray< dtype > gaussianFilter(const NdArray< dtype > &inImageArray, double inSigma, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
Definition gaussianFilter.hpp:56
Boundary
Boundary condition to apply to the image filter.
Definition Boundary.hpp:36
@ REFLECT
Definition Boundary.hpp:37
double gaussian(double inX, double inY, double inSigma) noexcept
Definition gaussian.hpp:46
NdArray< dtypeOut > astype(const NdArray< dtype > inArray)
Definition astype.hpp:45
std::uint32_t uint32
Definition Types.hpp:40