From 9bd8642f69bdbf5dfd01df45682efd50dd18fa53 Mon Sep 17 00:00:00 2001 From: Pranam Lashkari Date: Thu, 30 Dec 2021 10:17:37 +0530 Subject: [PATCH] numeric extension move into core part 5 moved numeric/kernel.hpp into core --- example/convolution.cpp | 2 +- example/convolve2d.cpp | 2 +- include/boost/gil/detail/math.hpp | 2 +- .../boost/gil/extension/numeric/kernel.hpp | 349 +---------------- .../boost/gil/image_processing/convolve.hpp | 2 +- include/boost/gil/image_processing/filter.hpp | 2 +- include/boost/gil/image_processing/harris.hpp | 2 +- .../boost/gil/image_processing/hessian.hpp | 2 +- include/boost/gil/image_processing/kernel.hpp | 362 ++++++++++++++++++ .../boost/gil/image_processing/morphology.hpp | 3 +- .../boost/gil/image_processing/numeric.hpp | 2 +- .../boost/gil/image_processing/threshold.hpp | 2 +- test/core/image_processing/CMakeLists.txt | 4 +- test/core/image_processing/Jamfile | 3 + .../image_processing}/kernel.cpp | 2 +- .../kernel_1d_fixed_even_size_fail.cpp | 2 +- .../image_processing}/kernel_fixed.cpp | 2 +- test/core/image_processing/test_fixture.hpp | 2 +- test/extension/numeric/CMakeLists.txt | 2 - test/extension/numeric/Jamfile | 4 +- 20 files changed, 387 insertions(+), 366 deletions(-) create mode 100644 include/boost/gil/image_processing/kernel.hpp rename test/{extension/numeric => core/image_processing}/kernel.cpp (99%) rename test/{extension/numeric => core/image_processing}/kernel_1d_fixed_even_size_fail.cpp (87%) rename test/{extension/numeric => core/image_processing}/kernel_fixed.cpp (99%) diff --git a/example/convolution.cpp b/example/convolution.cpp index 5093ccfcde..52c27b5d0f 100644 --- a/example/convolution.cpp +++ b/example/convolution.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include // Convolves the image with a Gaussian kernel. diff --git a/example/convolve2d.cpp b/example/convolve2d.cpp index e9e4422008..caa61c55e5 100644 --- a/example/convolve2d.cpp +++ b/example/convolve2d.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include diff --git a/include/boost/gil/detail/math.hpp b/include/boost/gil/detail/math.hpp index 934f11ac82..f7f45d2188 100644 --- a/include/boost/gil/detail/math.hpp +++ b/include/boost/gil/detail/math.hpp @@ -9,7 +9,7 @@ #define BOOST_GIL_IMAGE_PROCESSING_DETAIL_MATH_HPP #include -#include +#include namespace boost { namespace gil { namespace detail { diff --git a/include/boost/gil/extension/numeric/kernel.hpp b/include/boost/gil/extension/numeric/kernel.hpp index 5fc6419f0b..103df047af 100644 --- a/include/boost/gil/extension/numeric/kernel.hpp +++ b/include/boost/gil/extension/numeric/kernel.hpp @@ -1,6 +1,7 @@ // // Copyright 2005-2007 Adobe Systems Incorporated // Copyright 2019 Miral Shah +// Copyright 2022 Pranam Lashkari // // Distributed under the Boost Software License, Version 1.0 // See accompanying file LICENSE_1_0.txt or copy at @@ -10,352 +11,8 @@ #ifndef BOOST_GIL_EXTENSION_NUMERIC_KERNEL_HPP #define BOOST_GIL_EXTENSION_NUMERIC_KERNEL_HPP -#include -#include +#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace boost { namespace gil { - -// Definitions of 1D fixed-size and variable-size kernels and related operations - -namespace detail { - -/// \brief kernel adaptor for one-dimensional cores -/// Core needs to provide size(),begin(),end(),operator[], -/// value_type,iterator,const_iterator,reference,const_reference -template -class kernel_1d_adaptor : public Core -{ -public: - kernel_1d_adaptor() = default; - - explicit kernel_1d_adaptor(std::size_t center) - : center_(center) - { - BOOST_ASSERT(center_ < this->size()); - } - - kernel_1d_adaptor(std::size_t size, std::size_t center) - : Core(size) , center_(center) - { - BOOST_ASSERT(this->size() > 0); - BOOST_ASSERT(center_ < this->size()); // also implies `size() > 0` - } - - kernel_1d_adaptor(kernel_1d_adaptor const& other) - : Core(other), center_(other.center_) - { - BOOST_ASSERT(this->size() > 0); - BOOST_ASSERT(center_ < this->size()); // also implies `size() > 0` - } - - kernel_1d_adaptor& operator=(kernel_1d_adaptor const& other) - { - Core::operator=(other); - center_ = other.center_; - return *this; - } - - std::size_t left_size() const - { - BOOST_ASSERT(center_ < this->size()); - return center_; - } - - std::size_t right_size() const - { - BOOST_ASSERT(center_ < this->size()); - return this->size() - center_ - 1; - } - - auto center() -> std::size_t& - { - BOOST_ASSERT(center_ < this->size()); - return center_; - } - - auto center() const -> std::size_t const& - { - BOOST_ASSERT(center_ < this->size()); - return center_; - } - -private: - std::size_t center_{0}; -}; - -} // namespace detail - -/// \brief variable-size kernel -template > -class kernel_1d : public detail::kernel_1d_adaptor> -{ - using parent_t = detail::kernel_1d_adaptor>; -public: - - kernel_1d() = default; - kernel_1d(std::size_t size, std::size_t center) : parent_t(size, center) {} - - template - kernel_1d(FwdIterator elements, std::size_t size, std::size_t center) - : parent_t(size, center) - { - detail::copy_n(elements, size, this->begin()); - } - - kernel_1d(kernel_1d const& other) : parent_t(other) {} - kernel_1d& operator=(kernel_1d const& other) = default; -}; - -/// \brief static-size kernel -template -class kernel_1d_fixed : public detail::kernel_1d_adaptor> -{ - using parent_t = detail::kernel_1d_adaptor>; -public: - static constexpr std::size_t static_size = Size; - static_assert(static_size > 0, "kernel must have size greater than 0"); - static_assert(static_size % 2 == 1, "kernel size must be odd to ensure validity at the center"); - - kernel_1d_fixed() = default; - explicit kernel_1d_fixed(std::size_t center) : parent_t(center) {} - - template - explicit kernel_1d_fixed(FwdIterator elements, std::size_t center) - : parent_t(center) - { - detail::copy_n(elements, Size, this->begin()); - } - - kernel_1d_fixed(kernel_1d_fixed const& other) : parent_t(other) {} - kernel_1d_fixed& operator=(kernel_1d_fixed const& other) = default; -}; - -// TODO: This data member is odr-used and definition at namespace scope -// is required by C++11. Redundant and deprecated in C++17. -template -constexpr std::size_t kernel_1d_fixed::static_size; - -/// \brief reverse a kernel -template -inline Kernel reverse_kernel(Kernel const& kernel) -{ - Kernel result(kernel); - result.center() = kernel.right_size(); - std::reverse(result.begin(), result.end()); - return result; -} - - -namespace detail { - -template -class kernel_2d_adaptor : public Core -{ -public: - kernel_2d_adaptor() = default; - - explicit kernel_2d_adaptor(std::size_t center_y, std::size_t center_x) - : center_(center_x, center_y) - { - BOOST_ASSERT(center_.y < this->size() && center_.x < this->size()); - } - - kernel_2d_adaptor(std::size_t size, std::size_t center_y, std::size_t center_x) - : Core(size * size), square_size(size), center_(center_x, center_y) - { - BOOST_ASSERT(this->size() > 0); - BOOST_ASSERT(center_.y < this->size() && center_.x < this->size()); // implies `size() > 0` - } - - kernel_2d_adaptor(kernel_2d_adaptor const& other) - : Core(other), square_size(other.square_size), center_(other.center_.x, other.center_.y) - { - BOOST_ASSERT(this->size() > 0); - BOOST_ASSERT(center_.y < this->size() && center_.x < this->size()); // implies `size() > 0` - } - - kernel_2d_adaptor& operator=(kernel_2d_adaptor const& other) - { - Core::operator=(other); - center_.y = other.center_.y; - center_.x = other.center_.x; - square_size = other.square_size; - return *this; - } - - std::size_t upper_size() const - { - BOOST_ASSERT(center_.y < this->size()); - return center_.y; - } - - std::size_t lower_size() const - { - BOOST_ASSERT(center_.y < this->size()); - return this->size() - center_.y - 1; - } - - std::size_t left_size() const - { - BOOST_ASSERT(center_.x < this->size()); - return center_.x; - } - - std::size_t right_size() const - { - BOOST_ASSERT(center_.x < this->size()); - return this->size() - center_.x - 1; - } - - auto center_y() -> std::size_t& - { - BOOST_ASSERT(center_.y < this->size()); - return center_.y; - } - - auto center_y() const -> std::size_t const& - { - BOOST_ASSERT(center_.y < this->size()); - return center_.y; - } - - auto center_x() -> std::size_t& - { - BOOST_ASSERT(center_.x < this->size()); - return center_.x; - } - - auto center_x() const -> std::size_t const& - { - BOOST_ASSERT(center_.x < this->size()); - return center_.x; - } - - std::size_t size() const - { - return square_size; - } - - typename Core::value_type at(std::size_t x, std::size_t y) const - { - if (x >= this->size() || y >= this->size()) - { - throw std::out_of_range("Index out of range"); - } - return this->begin()[y * this->size() + x]; - } - -protected: - std::size_t square_size{0}; - -private: - point center_{0, 0}; -}; - -/// \brief variable-size kernel -template -< - typename T, - typename Allocator = std::allocator -> -class kernel_2d : public detail::kernel_2d_adaptor> -{ - using parent_t = detail::kernel_2d_adaptor>; - -public: - - kernel_2d() = default; - kernel_2d(std::size_t size,std::size_t center_y, std::size_t center_x) - : parent_t(size, center_y, center_x) - {} - - template - kernel_2d(FwdIterator elements, std::size_t size, std::size_t center_y, std::size_t center_x) - : parent_t(static_cast(std::sqrt(size)), center_y, center_x) - { - detail::copy_n(elements, size, this->begin()); - } - - kernel_2d(kernel_2d const& other) : parent_t(other) {} - kernel_2d& operator=(kernel_2d const& other) = default; -}; - -/// \brief static-size kernel -template -class kernel_2d_fixed : - public detail::kernel_2d_adaptor> -{ - using parent_t = detail::kernel_2d_adaptor>; -public: - static constexpr std::size_t static_size = Size; - static_assert(static_size > 0, "kernel must have size greater than 0"); - static_assert(static_size % 2 == 1, "kernel size must be odd to ensure validity at the center"); - - kernel_2d_fixed() - { - this->square_size = Size; - } - - explicit kernel_2d_fixed(std::size_t center_y, std::size_t center_x) : - parent_t(center_y, center_x) - { - this->square_size = Size; - } - - template - explicit kernel_2d_fixed(FwdIterator elements, std::size_t center_y, std::size_t center_x) - : parent_t(center_y, center_x) - { - this->square_size = Size; - detail::copy_n(elements, Size * Size, this->begin()); - } - - kernel_2d_fixed(kernel_2d_fixed const& other) : parent_t(other) {} - kernel_2d_fixed& operator=(kernel_2d_fixed const& other) = default; -}; - -// TODO: This data member is odr-used and definition at namespace scope -// is required by C++11. Redundant and deprecated in C++17. -template -constexpr std::size_t kernel_2d_fixed::static_size; - -template -inline Kernel reverse_kernel_2d(Kernel const& kernel) -{ - Kernel result(kernel); - result.center_x() = kernel.lower_size(); - result.center_y() = kernel.right_size(); - std::reverse(result.begin(), result.end()); - return result; -} - - -/// \brief reverse a kernel_2d -template -inline kernel_2d reverse_kernel(kernel_2d const& kernel) -{ - return reverse_kernel_2d(kernel); -} - -/// \brief reverse a kernel_2d -template -inline kernel_2d_fixed reverse_kernel(kernel_2d_fixed const& kernel) -{ - return reverse_kernel_2d(kernel); -} - -} //namespace detail - -}} // namespace boost::gil +BOOST_HEADER_DEPRECATED("") #endif diff --git a/include/boost/gil/image_processing/convolve.hpp b/include/boost/gil/image_processing/convolve.hpp index 0165aec2f3..a6369c89a6 100644 --- a/include/boost/gil/image_processing/convolve.hpp +++ b/include/boost/gil/image_processing/convolve.hpp @@ -10,7 +10,7 @@ #ifndef BOOST_GIL_IMAGE_PROCESSING_CONVOLVE_HPP #define BOOST_GIL_IMAGE_PROCESSING_CONVOLVE_HPP -#include +#include #include #include diff --git a/include/boost/gil/image_processing/filter.hpp b/include/boost/gil/image_processing/filter.hpp index 097a85f1c7..574c4cde5a 100644 --- a/include/boost/gil/image_processing/filter.hpp +++ b/include/boost/gil/image_processing/filter.hpp @@ -10,7 +10,7 @@ #ifndef BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP #define BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP -#include +#include #include diff --git a/include/boost/gil/image_processing/harris.hpp b/include/boost/gil/image_processing/harris.hpp index 18185afd81..56e0cdb30e 100644 --- a/include/boost/gil/image_processing/harris.hpp +++ b/include/boost/gil/image_processing/harris.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include namespace boost { namespace gil { /// \defgroup CornerDetectionAlgorithms diff --git a/include/boost/gil/image_processing/hessian.hpp b/include/boost/gil/image_processing/hessian.hpp index f37c0ffdd5..4d037e26a0 100644 --- a/include/boost/gil/image_processing/hessian.hpp +++ b/include/boost/gil/image_processing/hessian.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include namespace boost { namespace gil { diff --git a/include/boost/gil/image_processing/kernel.hpp b/include/boost/gil/image_processing/kernel.hpp new file mode 100644 index 0000000000..98682d2bb3 --- /dev/null +++ b/include/boost/gil/image_processing/kernel.hpp @@ -0,0 +1,362 @@ +// +// Copyright 2005-2007 Adobe Systems Incorporated +// Copyright 2019 Miral Shah +// Copyright 2022 Pranam Lashkari +// +// Distributed under the Boost Software License, Version 1.0 +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt +// + +#ifndef BOOST_GIL_IMAGE_PROCESSING_KERNEL_HPP +#define BOOST_GIL_IMAGE_PROCESSING_KERNEL_HPP + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace gil { + +// Definitions of 1D fixed-size and variable-size kernels and related operations + +namespace detail { + +/// \brief kernel adaptor for one-dimensional cores +/// Core needs to provide size(),begin(),end(),operator[], +/// value_type,iterator,const_iterator,reference,const_reference +template +class kernel_1d_adaptor : public Core +{ +public: + kernel_1d_adaptor() = default; + + explicit kernel_1d_adaptor(std::size_t center) + : center_(center) + { + BOOST_ASSERT(center_ < this->size()); + } + + kernel_1d_adaptor(std::size_t size, std::size_t center) + : Core(size) , center_(center) + { + BOOST_ASSERT(this->size() > 0); + BOOST_ASSERT(center_ < this->size()); // also implies `size() > 0` + } + + kernel_1d_adaptor(kernel_1d_adaptor const& other) + : Core(other), center_(other.center_) + { + BOOST_ASSERT(this->size() > 0); + BOOST_ASSERT(center_ < this->size()); // also implies `size() > 0` + } + + kernel_1d_adaptor& operator=(kernel_1d_adaptor const& other) + { + Core::operator=(other); + center_ = other.center_; + return *this; + } + + std::size_t left_size() const + { + BOOST_ASSERT(center_ < this->size()); + return center_; + } + + std::size_t right_size() const + { + BOOST_ASSERT(center_ < this->size()); + return this->size() - center_ - 1; + } + + auto center() -> std::size_t& + { + BOOST_ASSERT(center_ < this->size()); + return center_; + } + + auto center() const -> std::size_t const& + { + BOOST_ASSERT(center_ < this->size()); + return center_; + } + +private: + std::size_t center_{0}; +}; + +} // namespace detail + +/// \brief variable-size kernel +template > +class kernel_1d : public detail::kernel_1d_adaptor> +{ + using parent_t = detail::kernel_1d_adaptor>; +public: + + kernel_1d() = default; + kernel_1d(std::size_t size, std::size_t center) : parent_t(size, center) {} + + template + kernel_1d(FwdIterator elements, std::size_t size, std::size_t center) + : parent_t(size, center) + { + detail::copy_n(elements, size, this->begin()); + } + + kernel_1d(kernel_1d const& other) : parent_t(other) {} + kernel_1d& operator=(kernel_1d const& other) = default; +}; + +/// \brief static-size kernel +template +class kernel_1d_fixed : public detail::kernel_1d_adaptor> +{ + using parent_t = detail::kernel_1d_adaptor>; +public: + static constexpr std::size_t static_size = Size; + static_assert(static_size > 0, "kernel must have size greater than 0"); + static_assert(static_size % 2 == 1, "kernel size must be odd to ensure validity at the center"); + + kernel_1d_fixed() = default; + explicit kernel_1d_fixed(std::size_t center) : parent_t(center) {} + + template + explicit kernel_1d_fixed(FwdIterator elements, std::size_t center) + : parent_t(center) + { + detail::copy_n(elements, Size, this->begin()); + } + + kernel_1d_fixed(kernel_1d_fixed const& other) : parent_t(other) {} + kernel_1d_fixed& operator=(kernel_1d_fixed const& other) = default; +}; + +// TODO: This data member is odr-used and definition at namespace scope +// is required by C++11. Redundant and deprecated in C++17. +template +constexpr std::size_t kernel_1d_fixed::static_size; + +/// \brief reverse a kernel +template +inline Kernel reverse_kernel(Kernel const& kernel) +{ + Kernel result(kernel); + result.center() = kernel.right_size(); + std::reverse(result.begin(), result.end()); + return result; +} + + +namespace detail { + +template +class kernel_2d_adaptor : public Core +{ +public: + kernel_2d_adaptor() = default; + + explicit kernel_2d_adaptor(std::size_t center_y, std::size_t center_x) + : center_(center_x, center_y) + { + BOOST_ASSERT(center_.y < this->size() && center_.x < this->size()); + } + + kernel_2d_adaptor(std::size_t size, std::size_t center_y, std::size_t center_x) + : Core(size * size), square_size(size), center_(center_x, center_y) + { + BOOST_ASSERT(this->size() > 0); + BOOST_ASSERT(center_.y < this->size() && center_.x < this->size()); // implies `size() > 0` + } + + kernel_2d_adaptor(kernel_2d_adaptor const& other) + : Core(other), square_size(other.square_size), center_(other.center_.x, other.center_.y) + { + BOOST_ASSERT(this->size() > 0); + BOOST_ASSERT(center_.y < this->size() && center_.x < this->size()); // implies `size() > 0` + } + + kernel_2d_adaptor& operator=(kernel_2d_adaptor const& other) + { + Core::operator=(other); + center_.y = other.center_.y; + center_.x = other.center_.x; + square_size = other.square_size; + return *this; + } + + std::size_t upper_size() const + { + BOOST_ASSERT(center_.y < this->size()); + return center_.y; + } + + std::size_t lower_size() const + { + BOOST_ASSERT(center_.y < this->size()); + return this->size() - center_.y - 1; + } + + std::size_t left_size() const + { + BOOST_ASSERT(center_.x < this->size()); + return center_.x; + } + + std::size_t right_size() const + { + BOOST_ASSERT(center_.x < this->size()); + return this->size() - center_.x - 1; + } + + auto center_y() -> std::size_t& + { + BOOST_ASSERT(center_.y < this->size()); + return center_.y; + } + + auto center_y() const -> std::size_t const& + { + BOOST_ASSERT(center_.y < this->size()); + return center_.y; + } + + auto center_x() -> std::size_t& + { + BOOST_ASSERT(center_.x < this->size()); + return center_.x; + } + + auto center_x() const -> std::size_t const& + { + BOOST_ASSERT(center_.x < this->size()); + return center_.x; + } + + std::size_t size() const + { + return square_size; + } + + typename Core::value_type at(std::size_t x, std::size_t y) const + { + if (x >= this->size() || y >= this->size()) + { + throw std::out_of_range("Index out of range"); + } + return this->begin()[y * this->size() + x]; + } + +protected: + std::size_t square_size{0}; + +private: + point center_{0, 0}; +}; + +/// \brief variable-size kernel +template +< + typename T, + typename Allocator = std::allocator +> +class kernel_2d : public detail::kernel_2d_adaptor> +{ + using parent_t = detail::kernel_2d_adaptor>; + +public: + + kernel_2d() = default; + kernel_2d(std::size_t size,std::size_t center_y, std::size_t center_x) + : parent_t(size, center_y, center_x) + {} + + template + kernel_2d(FwdIterator elements, std::size_t size, std::size_t center_y, std::size_t center_x) + : parent_t(static_cast(std::sqrt(size)), center_y, center_x) + { + detail::copy_n(elements, size, this->begin()); + } + + kernel_2d(kernel_2d const& other) : parent_t(other) {} + kernel_2d& operator=(kernel_2d const& other) = default; +}; + +/// \brief static-size kernel +template +class kernel_2d_fixed : + public detail::kernel_2d_adaptor> +{ + using parent_t = detail::kernel_2d_adaptor>; +public: + static constexpr std::size_t static_size = Size; + static_assert(static_size > 0, "kernel must have size greater than 0"); + static_assert(static_size % 2 == 1, "kernel size must be odd to ensure validity at the center"); + + kernel_2d_fixed() + { + this->square_size = Size; + } + + explicit kernel_2d_fixed(std::size_t center_y, std::size_t center_x) : + parent_t(center_y, center_x) + { + this->square_size = Size; + } + + template + explicit kernel_2d_fixed(FwdIterator elements, std::size_t center_y, std::size_t center_x) + : parent_t(center_y, center_x) + { + this->square_size = Size; + detail::copy_n(elements, Size * Size, this->begin()); + } + + kernel_2d_fixed(kernel_2d_fixed const& other) : parent_t(other) {} + kernel_2d_fixed& operator=(kernel_2d_fixed const& other) = default; +}; + +// TODO: This data member is odr-used and definition at namespace scope +// is required by C++11. Redundant and deprecated in C++17. +template +constexpr std::size_t kernel_2d_fixed::static_size; + +template +inline Kernel reverse_kernel_2d(Kernel const& kernel) +{ + Kernel result(kernel); + result.center_x() = kernel.lower_size(); + result.center_y() = kernel.right_size(); + std::reverse(result.begin(), result.end()); + return result; +} + + +/// \brief reverse a kernel_2d +template +inline kernel_2d reverse_kernel(kernel_2d const& kernel) +{ + return reverse_kernel_2d(kernel); +} + +/// \brief reverse a kernel_2d +template +inline kernel_2d_fixed reverse_kernel(kernel_2d_fixed const& kernel) +{ + return reverse_kernel_2d(kernel); +} + +} //namespace detail + +}} // namespace boost::gil + +#endif diff --git a/include/boost/gil/image_processing/morphology.hpp b/include/boost/gil/image_processing/morphology.hpp index 1149b2c165..e2e1926ab4 100644 --- a/include/boost/gil/image_processing/morphology.hpp +++ b/include/boost/gil/image_processing/morphology.hpp @@ -8,7 +8,8 @@ #ifndef BOOST_GIL_IMAGE_PROCESSING_MORPHOLOGY_HPP #define BOOST_GIL_IMAGE_PROCESSING_MORPHOLOGY_HPP -#include + +#include #include #include diff --git a/include/boost/gil/image_processing/numeric.hpp b/include/boost/gil/image_processing/numeric.hpp index 6241c8490b..3ac989ccb9 100644 --- a/include/boost/gil/image_processing/numeric.hpp +++ b/include/boost/gil/image_processing/numeric.hpp @@ -9,7 +9,7 @@ #ifndef BOOST_GIL_IMAGE_PROCESSING_NUMERIC_HPP #define BOOST_GIL_IMAGE_PROCESSING_NUMERIC_HPP -#include +#include #include #include #include diff --git a/include/boost/gil/image_processing/threshold.hpp b/include/boost/gil/image_processing/threshold.hpp index 78809f6d38..b3b56356fc 100644 --- a/include/boost/gil/image_processing/threshold.hpp +++ b/include/boost/gil/image_processing/threshold.hpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/test/core/image_processing/CMakeLists.txt b/test/core/image_processing/CMakeLists.txt index f17160d6f2..680c41047c 100644 --- a/test/core/image_processing/CMakeLists.txt +++ b/test/core/image_processing/CMakeLists.txt @@ -26,7 +26,9 @@ foreach(_name convolve convolve_2d convolve_cols - convolve_rows) + convolve_rows + kernel + kernel_fixed) set(_test t_core_image_processing_${_name}) set(_target test_core_image_processing_${_name}) diff --git a/test/core/image_processing/Jamfile b/test/core/image_processing/Jamfile index c2f3274d58..6f4d77f76c 100644 --- a/test/core/image_processing/Jamfile +++ b/test/core/image_processing/Jamfile @@ -10,6 +10,7 @@ import testing ; compile-fail threshold_color_spaces_not_compatible_fail.cpp ; +compile-fail kernel_1d_fixed_even_size_fail.cpp ; run threshold_binary.cpp ; run threshold_truncate.cpp ; run threshold_otsu.cpp ; @@ -28,3 +29,5 @@ run convolve.cpp ; run convolve_2d.cpp ; run convolve_cols.cpp ; run convolve_rows.cpp ; +run kernel.cpp ; +run kernel_fixed.cpp ; diff --git a/test/extension/numeric/kernel.cpp b/test/core/image_processing/kernel.cpp similarity index 99% rename from test/extension/numeric/kernel.cpp rename to test/core/image_processing/kernel.cpp index a75f1cef83..781a74fa22 100644 --- a/test/extension/numeric/kernel.cpp +++ b/test/core/image_processing/kernel.cpp @@ -8,7 +8,7 @@ // #define BOOST_DISABLE_ASSERTS 1 // kernel_1d_adaptor assertions are too strict #include -#include +#include #include diff --git a/test/extension/numeric/kernel_1d_fixed_even_size_fail.cpp b/test/core/image_processing/kernel_1d_fixed_even_size_fail.cpp similarity index 87% rename from test/extension/numeric/kernel_1d_fixed_even_size_fail.cpp rename to test/core/image_processing/kernel_1d_fixed_even_size_fail.cpp index a8be85fcd7..9f78519b7f 100644 --- a/test/extension/numeric/kernel_1d_fixed_even_size_fail.cpp +++ b/test/core/image_processing/kernel_1d_fixed_even_size_fail.cpp @@ -5,7 +5,7 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // -#include +#include namespace gil = boost::gil; diff --git a/test/extension/numeric/kernel_fixed.cpp b/test/core/image_processing/kernel_fixed.cpp similarity index 99% rename from test/extension/numeric/kernel_fixed.cpp rename to test/core/image_processing/kernel_fixed.cpp index cfd075eafc..3f10246da1 100644 --- a/test/extension/numeric/kernel_fixed.cpp +++ b/test/core/image_processing/kernel_fixed.cpp @@ -8,7 +8,7 @@ // #define BOOST_DISABLE_ASSERTS 1 // kernel_1d_adaptor assertions are too strict #include -#include +#include #include diff --git a/test/core/image_processing/test_fixture.hpp b/test/core/image_processing/test_fixture.hpp index 5ac90c8b6a..b49fb6cd76 100644 --- a/test/core/image_processing/test_fixture.hpp +++ b/test/core/image_processing/test_fixture.hpp @@ -7,7 +7,7 @@ // http://www.boost.org/LICENSE_1_0.txt // #include -#include +#include #include #include diff --git a/test/extension/numeric/CMakeLists.txt b/test/extension/numeric/CMakeLists.txt index 33afaf5685..dccc0cc5c7 100644 --- a/test/extension/numeric/CMakeLists.txt +++ b/test/extension/numeric/CMakeLists.txt @@ -10,8 +10,6 @@ message(STATUS "Boost.GIL: Configuring tests in test/extension/numeric") foreach(_name - kernel - kernel_fixed matrix3x2 resample) set(_test t_ext_numeric_${_name}) diff --git a/test/extension/numeric/Jamfile b/test/extension/numeric/Jamfile index 3ce2b031f3..d538e7ab26 100644 --- a/test/extension/numeric/Jamfile +++ b/test/extension/numeric/Jamfile @@ -12,10 +12,8 @@ import testing ; alias headers : [ generate_self_contained_headers extension/numeric ] ; -compile-fail kernel_1d_fixed_even_size_fail.cpp ; -run kernel.cpp ; -run kernel_fixed.cpp ; + run matrix3x2.cpp ; run resample.cpp ;