57 template<
typename dtype>
67 constexpr
uint32 MIN_KERNEL_SIZE = 5;
69 if (kernelSize % 2 == 0)
74 const auto kernalHalfSize =
static_cast<double>(kernelSize / 2);
78 for (
double row = 0; row < kernelSize; ++row)
80 for (
double col = 0; col < kernelSize; ++col)
82 kernel(
static_cast<uint32>(row),
static_cast<uint32>(col)) =
95 inConstantValue).template astype<dtype>();
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:36
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
NdArray< dtype > sum(Axis inAxis=Axis::NONE) const
Definition: NdArrayCore.hpp:4598
value_type item() const
Definition: NdArrayCore.hpp:3102
NdArray< dtype > gaussianFilter(const NdArray< dtype > &inImageArray, double inSigma, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
Definition: gaussianFilter.hpp:58
NdArray< dtype > convolve(const NdArray< dtype > &inImageArray, uint32 inSize, const NdArray< dtype > &inWeights, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
Definition: convolve.hpp:62
Boundary
Boundary condition to apply to the image filter.
Definition: Boundary.hpp:37
double gaussian(double inX, double inY, double inSigma) noexcept
Definition: gaussian.hpp:48
Definition: Coordinate.hpp:45
dtype ceil(dtype inValue) noexcept
Definition: ceil.hpp:48
NdArray< dtype > max(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: max.hpp:45
std::uint32_t uint32
Definition: Types.hpp:40