From bab2a370ff09b4f526cd8e5084c5435208b8a799 Mon Sep 17 00:00:00 2001 From: Olzhas Zhumabek Date: Tue, 17 May 2022 23:28:32 +0600 Subject: [PATCH 1/8] Fix Hough transform and move rasterization Hough line transform had incorrect rounding which lead to misleading message --- CMakeLists.txt | 1 + example/hough_transform_line.cpp | 5 ++++- include/boost/gil.hpp | 6 +++--- include/boost/gil/{ => extension}/rasterization/circle.hpp | 4 ++-- include/boost/gil/{ => extension}/rasterization/ellipse.hpp | 0 include/boost/gil/{ => extension}/rasterization/line.hpp | 2 +- include/boost/gil/image_processing/hough_transform.hpp | 2 +- test/core/CMakeLists.txt | 3 +-- test/extension/CMakeLists.txt | 4 ++++ test/{core => extension}/rasterization/CMakeLists.txt | 0 test/{core => extension}/rasterization/Jamfile | 0 test/{core => extension}/rasterization/circle.cpp | 2 +- test/{core => extension}/rasterization/ellipse.cpp | 2 +- test/{core => extension}/rasterization/line.cpp | 4 ++-- 14 files changed, 21 insertions(+), 14 deletions(-) rename include/boost/gil/{ => extension}/rasterization/circle.hpp (98%) rename include/boost/gil/{ => extension}/rasterization/ellipse.hpp (100%) rename include/boost/gil/{ => extension}/rasterization/line.hpp (99%) rename test/{core => extension}/rasterization/CMakeLists.txt (100%) rename test/{core => extension}/rasterization/Jamfile (100%) rename test/{core => extension}/rasterization/circle.cpp (98%) rename test/{core => extension}/rasterization/ellipse.cpp (99%) rename test/{core => extension}/rasterization/line.cpp (98%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5de286f35d..a492c35066 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,7 @@ option(BOOST_GIL_ENABLE_EXT_DYNAMIC_IMAGE "Enable Dynamic Image extension, tests option(BOOST_GIL_ENABLE_EXT_IO "Enable IO extension, tests and examples (require libjpeg, libpng, libtiff)" ON) option(BOOST_GIL_ENABLE_EXT_NUMERIC "Enable Numeric extension, tests and examples" ON) option(BOOST_GIL_ENABLE_EXT_TOOLBOX "Enable Toolbox extension, tests and examples" ON) +option(BOOST_GIL_ENABLE_EXT_RASTERIZATION "Enable Rasterization extension and tests" ON) option(BOOST_GIL_USE_CONAN "Use Conan to install dependencies" OFF) option(BOOST_GIL_USE_CLANG_TIDY "Set CMAKE_CXX_CLANG_TIDY property on targets to enable clang-tidy linting" OFF) set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard version to use (default is 11)") diff --git a/example/hough_transform_line.cpp b/example/hough_transform_line.cpp index 75c9e611b6..0d9a14f943 100644 --- a/example/hough_transform_line.cpp +++ b/example/hough_transform_line.cpp @@ -52,7 +52,7 @@ int main() double _5_degrees = gil::detail::pi / 36; auto theta_parameter = gil::make_theta_parameter(_45_degrees, _5_degrees, input_view.dimensions()); - auto expected_radius = static_cast(std::round(std::cos(_45_degrees) * size)); + auto expected_radius = static_cast(std::floor(std::cos(_45_degrees) * size)); auto radius_parameter = gil::hough_parameter::from_step_size(expected_radius, 7, 1); gil::gray32_image_t accumulator_array_image(theta_parameter.step_count, @@ -70,6 +70,9 @@ int main() theta_parameter.start_point + theta_index * theta_parameter.step_size; std::ptrdiff_t current_radius = radius_parameter.start_point + radius_parameter.step_size * radius_index; + if (current_theta == _45_degrees && current_radius == expected_radius) { + std::cout << "* "; + } std::cout << "theta: " << current_theta << " radius: " << current_radius << " accumulated value: " << accumulator_array(theta_index, radius_index)[0] << '\n'; diff --git a/include/boost/gil.hpp b/include/boost/gil.hpp index 087c9fe8de..16088a0978 100644 --- a/include/boost/gil.hpp +++ b/include/boost/gil.hpp @@ -39,9 +39,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/include/boost/gil/rasterization/circle.hpp b/include/boost/gil/extension/rasterization/circle.hpp similarity index 98% rename from include/boost/gil/rasterization/circle.hpp rename to include/boost/gil/extension/rasterization/circle.hpp index 31c3cf6caf..b91650f673 100644 --- a/include/boost/gil/rasterization/circle.hpp +++ b/include/boost/gil/extension/rasterization/circle.hpp @@ -9,8 +9,8 @@ #ifndef BOOST_GIL_RASTERIZATION_CIRCLE_HPP #define BOOST_GIL_RASTERIZATION_CIRCLE_HPP -#include -#include +#include "boost/gil/detail/math.hpp" +#include "boost/gil/point.hpp" #include #include diff --git a/include/boost/gil/rasterization/ellipse.hpp b/include/boost/gil/extension/rasterization/ellipse.hpp similarity index 100% rename from include/boost/gil/rasterization/ellipse.hpp rename to include/boost/gil/extension/rasterization/ellipse.hpp diff --git a/include/boost/gil/rasterization/line.hpp b/include/boost/gil/extension/rasterization/line.hpp similarity index 99% rename from include/boost/gil/rasterization/line.hpp rename to include/boost/gil/extension/rasterization/line.hpp index 1ff91b6a35..79ee5029e8 100644 --- a/include/boost/gil/rasterization/line.hpp +++ b/include/boost/gil/extension/rasterization/line.hpp @@ -7,7 +7,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include +#include "boost/gil/point.hpp" #include #include diff --git a/include/boost/gil/image_processing/hough_transform.hpp b/include/boost/gil/image_processing/hough_transform.hpp index 982c28c1f9..1de81f0768 100644 --- a/include/boost/gil/image_processing/hough_transform.hpp +++ b/include/boost/gil/image_processing/hough_transform.hpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt index 2c812d014b..761632decd 100644 --- a/test/core/CMakeLists.txt +++ b/test/core/CMakeLists.txt @@ -39,5 +39,4 @@ add_subdirectory(image) add_subdirectory(image_view) add_subdirectory(algorithm) add_subdirectory(image_processing) -add_subdirectory(histogram) -add_subdirectory(rasterization) +add_subdirectory(histogram) \ No newline at end of file diff --git a/test/extension/CMakeLists.txt b/test/extension/CMakeLists.txt index 9f7883066f..2d4c9c578a 100644 --- a/test/extension/CMakeLists.txt +++ b/test/extension/CMakeLists.txt @@ -5,6 +5,10 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # +if(BOOST_GIL_ENABLE_EXT_RASTERIZATION) + add_subdirectory(rasterization) +endif() + if(BOOST_GIL_ENABLE_EXT_DYNAMIC_IMAGE) add_subdirectory(dynamic_image) endif() diff --git a/test/core/rasterization/CMakeLists.txt b/test/extension/rasterization/CMakeLists.txt similarity index 100% rename from test/core/rasterization/CMakeLists.txt rename to test/extension/rasterization/CMakeLists.txt diff --git a/test/core/rasterization/Jamfile b/test/extension/rasterization/Jamfile similarity index 100% rename from test/core/rasterization/Jamfile rename to test/extension/rasterization/Jamfile diff --git a/test/core/rasterization/circle.cpp b/test/extension/rasterization/circle.cpp similarity index 98% rename from test/core/rasterization/circle.cpp rename to test/extension/rasterization/circle.cpp index b4c85c7da4..33af44c491 100644 --- a/test/core/rasterization/circle.cpp +++ b/test/extension/rasterization/circle.cpp @@ -8,7 +8,7 @@ // #include -#include +#include "boost/gil/extension/rasterization/circle.hpp" #include #include diff --git a/test/core/rasterization/ellipse.cpp b/test/extension/rasterization/ellipse.cpp similarity index 99% rename from test/core/rasterization/ellipse.cpp rename to test/extension/rasterization/ellipse.cpp index 58b5f43458..495e40400a 100644 --- a/test/core/rasterization/ellipse.cpp +++ b/test/extension/rasterization/ellipse.cpp @@ -6,7 +6,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // #include -#include +#include "boost/gil.hpp" #include #include #include diff --git a/test/core/rasterization/line.cpp b/test/extension/rasterization/line.cpp similarity index 98% rename from test/core/rasterization/line.cpp rename to test/extension/rasterization/line.cpp index 42e3bf7469..92986edbf4 100644 --- a/test/core/rasterization/line.cpp +++ b/test/extension/rasterization/line.cpp @@ -9,8 +9,8 @@ #include #include -#include -#include +#include "boost/gil/point.hpp" +#include "boost/gil/extension/rasterization/line.hpp" #include #include From f87ee565c1c4157b880c729d04b1d21d1f6dcc2f Mon Sep 17 00:00:00 2001 From: Olzhas Zhumabek Date: Wed, 18 May 2022 02:03:36 +0600 Subject: [PATCH 2/8] In depth explanation for Hough line Added in depth explanation for Hough line transform in the associated markdown file --- example/histogram_equalization.md | 46 +++++++++++++++++++++++++++++++ example/hough_transform_line.cpp | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/example/histogram_equalization.md b/example/histogram_equalization.md index c3dcd57832..eb71568dac 100644 --- a/example/histogram_equalization.md +++ b/example/histogram_equalization.md @@ -7,6 +7,52 @@ Histogram equalization capabilities in GIL are demonstrated by the program `hist The program doesn't take any argument on the command line. +Hough line transform solves the equation of a line in reverse, but in *polar coordinates*! The implementation will make each pixel vote on all possible lines it could be part of, limited by input Hough parameters. + +A line in polar coordinates is represented by normal to it in polar coordinates, as shown in example here +https://docs.opencv.org/3.4/d9/db0/tutorial_hough_lines.html + +Since real line is the diagonal throughout the image, the angle of normal to it will 45 degrees. (1s represent real line, 5s represent normal to it). + +``` +1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 +0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 +0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 +0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 +0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 +0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 +0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 +5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 +``` + +It is obvious that the angle for the expected Hough transform is 45 degrees (angle between 5s and bottom 0s). Now we +need to find the length of 5s. Since 5s, 1s and bottom 0s form a right triangle, we know that bottom 0s are 32 in length +and is a hypotenuse! Using trivial trigonometry we know that the length we are searching for is 32 * cos(45). + `histogram_equalization` expects to find an image called `test_adaptive.png` in the current directory, and produces an image in return, where the equalization have been applied: `histogram_gray_equalized.png`. ## Specific requirements diff --git a/example/hough_transform_line.cpp b/example/hough_transform_line.cpp index 0d9a14f943..d67fff5b59 100644 --- a/example/hough_transform_line.cpp +++ b/example/hough_transform_line.cpp @@ -25,7 +25,7 @@ namespace gil = boost::gil; int main() { - std::ptrdiff_t size = 32; + const std::ptrdiff_t size = 32; gil::gray16_image_t input_image(size, size); auto input_view = gil::view(input_image); From cc39f1a007578c4bfda003641d53cf9c91f6e247 Mon Sep 17 00:00:00 2001 From: Olzhas Zhumabek Date: Wed, 18 May 2022 02:31:39 +0600 Subject: [PATCH 3/8] Change "" includes into <> --- include/boost/gil/extension/rasterization/circle.hpp | 4 ++-- include/boost/gil/extension/rasterization/line.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/gil/extension/rasterization/circle.hpp b/include/boost/gil/extension/rasterization/circle.hpp index b91650f673..31c3cf6caf 100644 --- a/include/boost/gil/extension/rasterization/circle.hpp +++ b/include/boost/gil/extension/rasterization/circle.hpp @@ -9,8 +9,8 @@ #ifndef BOOST_GIL_RASTERIZATION_CIRCLE_HPP #define BOOST_GIL_RASTERIZATION_CIRCLE_HPP -#include "boost/gil/detail/math.hpp" -#include "boost/gil/point.hpp" +#include +#include #include #include diff --git a/include/boost/gil/extension/rasterization/line.hpp b/include/boost/gil/extension/rasterization/line.hpp index 79ee5029e8..1ff91b6a35 100644 --- a/include/boost/gil/extension/rasterization/line.hpp +++ b/include/boost/gil/extension/rasterization/line.hpp @@ -7,7 +7,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include "boost/gil/point.hpp" +#include #include #include From 48d7ebffe06bfc97466f6f09e3382cc91aa3a5ed Mon Sep 17 00:00:00 2001 From: Olzhas Zhumabek Date: Thu, 19 May 2022 16:46:18 +0600 Subject: [PATCH 4/8] Move diffusion and Hough transform Move anisotropic diffusion and Hough transform into extension. Adjust tests and cmakelists --- CMakeLists.txt | 1 + example/anisotropic_diffusion.cpp | 2 +- include/boost/gil.hpp | 6 ++--- .../image_processing/diffusion.hpp | 2 +- .../image_processing/hough_parameter.hpp | 2 +- .../image_processing/hough_transform.hpp | 2 +- test/core/image_processing/CMakeLists.txt | 4 ---- test/extension/CMakeLists.txt | 4 ++++ .../extension/image_processing/CMakeLists.txt | 22 +++++++++++++++++++ .../anisotropic_diffusion.cpp | 6 ++--- .../hough_circle_transform.cpp | 2 +- .../image_processing/hough_line_transform.cpp | 4 ++-- .../image_processing/hough_parameter.cpp | 2 +- 13 files changed, 41 insertions(+), 18 deletions(-) rename include/boost/gil/{ => extension}/image_processing/diffusion.hpp (99%) rename include/boost/gil/{ => extension}/image_processing/hough_parameter.hpp (99%) rename include/boost/gil/{ => extension}/image_processing/hough_transform.hpp (98%) create mode 100644 test/extension/image_processing/CMakeLists.txt rename test/{core => extension}/image_processing/anisotropic_diffusion.cpp (98%) rename test/{core => extension}/image_processing/hough_circle_transform.cpp (97%) rename test/{core => extension}/image_processing/hough_line_transform.cpp (96%) rename test/{core => extension}/image_processing/hough_parameter.cpp (97%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a492c35066..aee245bbfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ option(BOOST_GIL_ENABLE_EXT_IO "Enable IO extension, tests and examples (require option(BOOST_GIL_ENABLE_EXT_NUMERIC "Enable Numeric extension, tests and examples" ON) option(BOOST_GIL_ENABLE_EXT_TOOLBOX "Enable Toolbox extension, tests and examples" ON) option(BOOST_GIL_ENABLE_EXT_RASTERIZATION "Enable Rasterization extension and tests" ON) +option(BOOST_GIL_ENABLE_EXT_IMAGE_PROCESSING "Enable Image Processing extension (!) and tests" ON) option(BOOST_GIL_USE_CONAN "Use Conan to install dependencies" OFF) option(BOOST_GIL_USE_CLANG_TIDY "Set CMAKE_CXX_CLANG_TIDY property on targets to enable clang-tidy linting" OFF) set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard version to use (default is 11)") diff --git a/example/anisotropic_diffusion.cpp b/example/anisotropic_diffusion.cpp index c96533647c..04c95406bd 100644 --- a/example/anisotropic_diffusion.cpp +++ b/example/anisotropic_diffusion.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include "boost/gil/extension/image_processing/diffusion.hpp" #include #include #include diff --git a/include/boost/gil.hpp b/include/boost/gil.hpp index 16088a0978..9bfba80240 100644 --- a/include/boost/gil.hpp +++ b/include/boost/gil.hpp @@ -49,14 +49,14 @@ #include #include #include -#include +#include "boost/gil/extension/image_processing/diffusion.hpp" #include #include #include #include #include -#include -#include +#include "boost/gil/extension/image_processing/hough_parameter.hpp" +#include "boost/gil/extension/image_processing/hough_transform.hpp" #include #include #include diff --git a/include/boost/gil/image_processing/diffusion.hpp b/include/boost/gil/extension/image_processing/diffusion.hpp similarity index 99% rename from include/boost/gil/image_processing/diffusion.hpp rename to include/boost/gil/extension/image_processing/diffusion.hpp index fb1c86a4d3..d40c875c64 100644 --- a/include/boost/gil/image_processing/diffusion.hpp +++ b/include/boost/gil/extension/image_processing/diffusion.hpp @@ -10,7 +10,7 @@ #ifndef BOOST_GIL_IMAGE_PROCESSING_DIFFUSION_HPP #define BOOST_GIL_IMAGE_PROCESSING_DIFFUSION_HPP -#include "boost/gil/detail/math.hpp" +#include #include #include #include diff --git a/include/boost/gil/image_processing/hough_parameter.hpp b/include/boost/gil/extension/image_processing/hough_parameter.hpp similarity index 99% rename from include/boost/gil/image_processing/hough_parameter.hpp rename to include/boost/gil/extension/image_processing/hough_parameter.hpp index 97fcd8cde5..66b031346a 100644 --- a/include/boost/gil/image_processing/hough_parameter.hpp +++ b/include/boost/gil/extension/image_processing/hough_parameter.hpp @@ -9,7 +9,7 @@ #ifndef BOOST_GIL_IMAGE_PROCESSING_HOUGH_PARAMETER_HPP #define BOOST_GIL_IMAGE_PROCESSING_HOUGH_PARAMETER_HPP -#include +#include "boost/gil/point.hpp" #include #include diff --git a/include/boost/gil/image_processing/hough_transform.hpp b/include/boost/gil/extension/image_processing/hough_transform.hpp similarity index 98% rename from include/boost/gil/image_processing/hough_transform.hpp rename to include/boost/gil/extension/image_processing/hough_transform.hpp index 1de81f0768..39eb8dc1da 100644 --- a/include/boost/gil/image_processing/hough_transform.hpp +++ b/include/boost/gil/extension/image_processing/hough_transform.hpp @@ -10,7 +10,7 @@ #define BOOST_GIL_IMAGE_PROCESSING_HOUGH_TRANSFORM_HPP #include -#include +#include #include #include #include diff --git a/test/core/image_processing/CMakeLists.txt b/test/core/image_processing/CMakeLists.txt index 680c41047c..a2a8e08fbc 100644 --- a/test/core/image_processing/CMakeLists.txt +++ b/test/core/image_processing/CMakeLists.txt @@ -19,10 +19,6 @@ foreach(_name box_filter median_filter sobel_scharr - anisotropic_diffusion - hough_parameter - hough_line_transform - hough_circle_transform convolve convolve_2d convolve_cols diff --git a/test/extension/CMakeLists.txt b/test/extension/CMakeLists.txt index 2d4c9c578a..df1cfd72b3 100644 --- a/test/extension/CMakeLists.txt +++ b/test/extension/CMakeLists.txt @@ -9,6 +9,10 @@ if(BOOST_GIL_ENABLE_EXT_RASTERIZATION) add_subdirectory(rasterization) endif() +if(BOOST_GIL_ENABLE_EXT_IMAGE_PROCESSING) + add_subdirectory(image_processing) +endif() + if(BOOST_GIL_ENABLE_EXT_DYNAMIC_IMAGE) add_subdirectory(dynamic_image) endif() diff --git a/test/extension/image_processing/CMakeLists.txt b/test/extension/image_processing/CMakeLists.txt new file mode 100644 index 0000000000..62e6f79595 --- /dev/null +++ b/test/extension/image_processing/CMakeLists.txt @@ -0,0 +1,22 @@ +foreach(_name + anisotropic_diffusion + hough_circle_transform + hough_line_transform + hough_parameter) + set(_test t_ext_image_processing_${_name}) + set(_target test_ext_image_processing_${_name}) + + add_executable(${_target} "") + target_sources(${_target} PRIVATE ${_name}.cpp) + target_link_libraries(${_target} + PRIVATE + gil_compile_options + gil_include_directories + gil_dependencies) + target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) + add_test(NAME ${_test} COMMAND ${_target}) + + unset(_name) + unset(_target) + unset(_test) +endforeach() diff --git a/test/core/image_processing/anisotropic_diffusion.cpp b/test/extension/image_processing/anisotropic_diffusion.cpp similarity index 98% rename from test/core/image_processing/anisotropic_diffusion.cpp rename to test/extension/image_processing/anisotropic_diffusion.cpp index 58a5c9d6ce..302b43de58 100644 --- a/test/core/image_processing/anisotropic_diffusion.cpp +++ b/test/extension/image_processing/anisotropic_diffusion.cpp @@ -5,11 +5,11 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -#include "../test_fixture.hpp" -#include "boost/gil/algorithm.hpp" +#include +#include #include #include -#include +#include #include #include #include diff --git a/test/core/image_processing/hough_circle_transform.cpp b/test/extension/image_processing/hough_circle_transform.cpp similarity index 97% rename from test/core/image_processing/hough_circle_transform.cpp rename to test/extension/image_processing/hough_circle_transform.cpp index 9b0a3563da..67156e51a1 100644 --- a/test/core/image_processing/hough_circle_transform.cpp +++ b/test/extension/image_processing/hough_circle_transform.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include diff --git a/test/core/image_processing/hough_line_transform.cpp b/test/extension/image_processing/hough_line_transform.cpp similarity index 96% rename from test/core/image_processing/hough_line_transform.cpp rename to test/extension/image_processing/hough_line_transform.cpp index f0ed992fa3..3be4194261 100644 --- a/test/core/image_processing/hough_line_transform.cpp +++ b/test/extension/image_processing/hough_line_transform.cpp @@ -10,10 +10,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include #include #include diff --git a/test/core/image_processing/hough_parameter.cpp b/test/extension/image_processing/hough_parameter.cpp similarity index 97% rename from test/core/image_processing/hough_parameter.cpp rename to test/extension/image_processing/hough_parameter.cpp index 8d1c7b4452..9fd4b4a95f 100644 --- a/test/core/image_processing/hough_parameter.cpp +++ b/test/extension/image_processing/hough_parameter.cpp @@ -7,7 +7,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // #include -#include +#include namespace gil = boost::gil; From b962a6a2dba6a75cab9177fa7a36a66016c9b3cb Mon Sep 17 00:00:00 2001 From: Olzhas Zhumabek Date: Fri, 27 May 2022 01:40:15 +0600 Subject: [PATCH 5/8] Edit Jamfile to new layout --- test/core/Jamfile | 1 - test/extension/Jamfile | 2 ++ test/extension/image_processing/Jamfile | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 test/extension/image_processing/Jamfile diff --git a/test/core/Jamfile b/test/core/Jamfile index bc1e5f55d7..9305b8762c 100644 --- a/test/core/Jamfile +++ b/test/core/Jamfile @@ -33,4 +33,3 @@ build-project image_view ; build-project algorithm ; build-project image_processing ; build-project histogram ; -build-project rasterization ; diff --git a/test/extension/Jamfile b/test/extension/Jamfile index 5754513279..8c7790d2e2 100644 --- a/test/extension/Jamfile +++ b/test/extension/Jamfile @@ -11,3 +11,5 @@ build-project histogram ; build-project numeric ; build-project toolbox ; build-project io ; +build-project image_processing ; +build-project rasterization ; diff --git a/test/extension/image_processing/Jamfile b/test/extension/image_processing/Jamfile new file mode 100644 index 0000000000..6ab73640d1 --- /dev/null +++ b/test/extension/image_processing/Jamfile @@ -0,0 +1,14 @@ +# Boost.GIL (Generic Image Library) - tests +# +# Copyright 2020 Olzhas Zhumabek +# +# Use, modification and distribution are subject to 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) +# +import testing ; + +run anisotropic_diffusion.cpp ; +run hough_circle_transform.cpp ; +run hough_line_transform.cpp ; +run hough_parameter.cpp ; \ No newline at end of file From 76dcca89f4777f50089a1bb110f8f35cd3fd8318 Mon Sep 17 00:00:00 2001 From: Olzhas Zhumabek Date: Fri, 27 May 2022 01:53:01 +0600 Subject: [PATCH 6/8] Add compile statements to Jamfile --- test/extension/image_processing/Jamfile | 5 +++++ test/extension/rasterization/Jamfile | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/test/extension/image_processing/Jamfile b/test/extension/image_processing/Jamfile index 6ab73640d1..7320eb40d0 100644 --- a/test/extension/image_processing/Jamfile +++ b/test/extension/image_processing/Jamfile @@ -8,6 +8,11 @@ # import testing ; +compile anisotropic_diffusion.cpp ; +compile hough_circle_transform.cpp ; +compile hough_line_transform.cpp ; +compile hough_parameter.cpp ; + run anisotropic_diffusion.cpp ; run hough_circle_transform.cpp ; run hough_line_transform.cpp ; diff --git a/test/extension/rasterization/Jamfile b/test/extension/rasterization/Jamfile index 6be4cd9705..0a2cae3040 100644 --- a/test/extension/rasterization/Jamfile +++ b/test/extension/rasterization/Jamfile @@ -8,6 +8,10 @@ # import testing ; +compile line.cpp ; +compile circle.cpp ; +compile ellipse.cpp ; + run line.cpp ; run circle.cpp ; run ellipse.cpp ; From 3965f2ab99a27498cb94f761c186fd08cae780ae Mon Sep 17 00:00:00 2001 From: Olzhas Zhumabek Date: Tue, 31 May 2022 02:37:28 +0600 Subject: [PATCH 7/8] Remove migrated files --- test/core/image_processing/Jamfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/core/image_processing/Jamfile b/test/core/image_processing/Jamfile index 6f4d77f76c..562860e811 100644 --- a/test/core/image_processing/Jamfile +++ b/test/core/image_processing/Jamfile @@ -21,9 +21,6 @@ run hessian.cpp ; run sobel_scharr.cpp ; run box_filter.cpp ; run median_filter.cpp ; -run anisotropic_diffusion.cpp ; -run hough_line_transform.cpp ; -run hough_circle_transform.cpp ; run morphology.cpp ; run convolve.cpp ; run convolve_2d.cpp ; From 45da544873eb32eff2ef4a2c72c641775f11fa43 Mon Sep 17 00:00:00 2001 From: Olzhas Zhumabek Date: Tue, 31 May 2022 02:39:13 +0600 Subject: [PATCH 8/8] Removed redundant lines --- test/extension/image_processing/Jamfile | 5 ----- test/extension/rasterization/Jamfile | 4 ---- 2 files changed, 9 deletions(-) diff --git a/test/extension/image_processing/Jamfile b/test/extension/image_processing/Jamfile index 7320eb40d0..6ab73640d1 100644 --- a/test/extension/image_processing/Jamfile +++ b/test/extension/image_processing/Jamfile @@ -8,11 +8,6 @@ # import testing ; -compile anisotropic_diffusion.cpp ; -compile hough_circle_transform.cpp ; -compile hough_line_transform.cpp ; -compile hough_parameter.cpp ; - run anisotropic_diffusion.cpp ; run hough_circle_transform.cpp ; run hough_line_transform.cpp ; diff --git a/test/extension/rasterization/Jamfile b/test/extension/rasterization/Jamfile index 0a2cae3040..6be4cd9705 100644 --- a/test/extension/rasterization/Jamfile +++ b/test/extension/rasterization/Jamfile @@ -8,10 +8,6 @@ # import testing ; -compile line.cpp ; -compile circle.cpp ; -compile ellipse.cpp ; - run line.cpp ; run circle.cpp ; run ellipse.cpp ;