123456789101112131415161718192021222324252627282930313233 |
- #ifndef BOOST_GIL_IMAGE_PROCESSING_DETAIL_MATH_HPP
- #define BOOST_GIL_IMAGE_PROCESSING_DETAIL_MATH_HPP
- #include <array>
- #include <boost/gil/extension/numeric/kernel.hpp>
- namespace boost { namespace gil { namespace detail {
- static constexpr double pi = 3.14159265358979323846;
- static constexpr std::array<float, 9> dx_sobel = {{-1, 0, 1, -2, 0, 2, -1, 0, 1}};
- static constexpr std::array<float, 9> dx_scharr = {{-1, 0, 1, -1, 0, 1, -1, 0, 1}};
- static constexpr std::array<float, 9> dy_sobel = {{1, 2, 1, 0, 0, 0, -1, -2, -1}};
- static constexpr std::array<float, 9> dy_scharr = {{1, 1, 1, 0, 0, 0, -1, -1, -1}};
- template <typename T, typename Allocator>
- inline detail::kernel_2d<T, Allocator> get_identity_kernel()
- {
- detail::kernel_2d<T, Allocator> kernel(1, 0, 0);
- kernel[0] = 1;
- return kernel;
- }
- }}}
- #endif
|