NumCpp  2.10.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
Filter/Filters/Filters2d/laplace.hpp
Go to the documentation of this file.
1 #pragma once
29 
31 #include "NumCpp/NdArray.hpp"
32 
33 namespace nc::filter
34 {
35  //============================================================================
36  // Method Description:
47  template<typename dtype>
48  NdArray<dtype> laplace(const NdArray<dtype>& inImageArray,
49  Boundary inBoundaryType = Boundary::REFLECT,
50  dtype inConstantValue = 0)
51  {
52  NdArray<dtype> kernel = { { 0, 1, 0 }, { 1, -4, 1 }, { 0, 1, 0 } };
53  return convolve(inImageArray, 3, kernel, inBoundaryType, inConstantValue);
54  }
55 } // namespace nc::filter
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:138
Definition: addBoundary1d.hpp:44
NdArray< dtype > laplace(const NdArray< dtype > &inImageArray, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
Definition: Filter/Filters/Filters2d/laplace.hpp:48
NdArray< dtype > convolve(const NdArray< dtype > &inImageArray, uint32 inSize, const NdArray< dtype > &inWeights, Boundary inBoundaryType=Boundary::REFLECT, dtype inConstantValue=0)
Definition: convolve.hpp:60
Boundary
Boundary condition to apply to the image filter.
Definition: Boundary.hpp:36