From 0ba56c3ecc2009ab8a9f7fd79900f6aab3c22c05 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 12 May 2026 18:52:20 +0300 Subject: [PATCH] Moved IntelligentScissors to photo module. --- modules/imgproc/include/opencv2/imgproc.hpp | 4 ---- modules/imgproc/misc/js/gen_dict.json | 13 +------------ modules/photo/include/opencv2/photo.hpp | 2 ++ .../include/opencv2/photo}/segmentation.hpp | 12 ++++++------ modules/photo/misc/js/gen_dict.json | 13 ++++++++++++- .../perf/perf_intelligent_scissors.cpp | 0 .../{imgproc => photo}/src/intelligent_scissors.cpp | 0 .../test/test_intelligent_scissors.cpp | 0 samples/cpp/CMakeLists.txt | 4 ++-- ...proc_segmentation.cpp => photo_segmentation.cpp} | 4 ++-- 10 files changed, 25 insertions(+), 27 deletions(-) rename modules/{imgproc/include/opencv2/imgproc => photo/include/opencv2/photo}/segmentation.hpp (95%) rename modules/{imgproc => photo}/perf/perf_intelligent_scissors.cpp (100%) rename modules/{imgproc => photo}/src/intelligent_scissors.cpp (100%) rename modules/{imgproc => photo}/test/test_intelligent_scissors.cpp (100%) rename samples/cpp/tutorial_code/snippets/{imgproc_segmentation.cpp => photo_segmentation.cpp} (92%) diff --git a/modules/imgproc/include/opencv2/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc.hpp index 01ca3329a9..be8bac3357 100644 --- a/modules/imgproc/include/opencv2/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc.hpp @@ -5222,8 +5222,4 @@ Point LineIterator::pos() const } // cv - -#include "./imgproc/segmentation.hpp" - - #endif diff --git a/modules/imgproc/misc/js/gen_dict.json b/modules/imgproc/misc/js/gen_dict.json index f1ae7b8584..eeb876cd79 100644 --- a/modules/imgproc/misc/js/gen_dict.json +++ b/modules/imgproc/misc/js/gen_dict.json @@ -102,17 +102,6 @@ "watershed" ], "CLAHE": ["apply", "collectGarbage", "getClipLimit", "getTilesGridSize", "setClipLimit", "setTilesGridSize"], - "FontFace": ["set", "getName", "setInstance", "getInstance", "getBuiltinFontData"], - "segmentation_IntelligentScissorsMB": [ - "IntelligentScissorsMB", - "setWeights", - "setGradientMagnitudeMaxLimit", - "setEdgeFeatureZeroCrossingParameters", - "setEdgeFeatureCannyParameters", - "applyImage", - "applyImageFeatures", - "buildMap", - "getContour" - ] + "FontFace": ["set", "getName", "setInstance", "getInstance", "getBuiltinFontData"] } } diff --git a/modules/photo/include/opencv2/photo.hpp b/modules/photo/include/opencv2/photo.hpp index e7f04ce9cf..158bc24c3a 100644 --- a/modules/photo/include/opencv2/photo.hpp +++ b/modules/photo/include/opencv2/photo.hpp @@ -962,4 +962,6 @@ CV_EXPORTS_W void loadChromaticAberrationParams( } // cv +#include "./photo/segmentation.hpp" + #endif diff --git a/modules/imgproc/include/opencv2/imgproc/segmentation.hpp b/modules/photo/include/opencv2/photo/segmentation.hpp similarity index 95% rename from modules/imgproc/include/opencv2/imgproc/segmentation.hpp rename to modules/photo/include/opencv2/photo/segmentation.hpp index b2df4fcaca..c0ca8da3fe 100644 --- a/modules/imgproc/include/opencv2/imgproc/segmentation.hpp +++ b/modules/photo/include/opencv2/photo/segmentation.hpp @@ -2,16 +2,16 @@ // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. -#ifndef OPENCV_IMGPROC_SEGMENTATION_HPP -#define OPENCV_IMGPROC_SEGMENTATION_HPP +#ifndef OPENCV_PHOTO_SEGMENTATION_HPP +#define OPENCV_PHOTO_SEGMENTATION_HPP -#include "opencv2/imgproc.hpp" +#include "opencv2/photo.hpp" namespace cv { namespace segmentation { -//! @addtogroup imgproc_segmentation +//! @addtogroup photo_segmentation //! @{ @@ -21,7 +21,7 @@ namespace segmentation { * which can be used for image segmentation. * * Usage example: - * @snippet snippets/imgproc_segmentation.cpp usage_example_intelligent_scissors + * @snippet snippets/photo_segmentation.cpp usage_example_intelligent_scissors * * Reference: "Intelligent Scissors for Image Composition" * algorithm designed by Eric N. Mortensen and William A. Barrett, Brigham Young University @@ -138,4 +138,4 @@ protected: } // namespace segmentation } // namespace cv -#endif // OPENCV_IMGPROC_SEGMENTATION_HPP +#endif // OPENCV_PHOTO_SEGMENTATION_HPP diff --git a/modules/photo/misc/js/gen_dict.json b/modules/photo/misc/js/gen_dict.json index c03b081b34..91cf5973c6 100644 --- a/modules/photo/misc/js/gen_dict.json +++ b/modules/photo/misc/js/gen_dict.json @@ -21,6 +21,17 @@ "getSigmaColor", "setSigmaColor", "getSigmaSpace","setSigmaSpace"], "TonemapMantiuk" : ["getScale", "setScale", "getSaturation", "setSaturation"], "TonemapReinhard" : ["getIntensity", "setIntensity", "getLightAdaptation", "setLightAdaptation", - "getColorAdaptation", "setColorAdaptation"] + "getColorAdaptation", "setColorAdaptation"], + "segmentation_IntelligentScissorsMB": [ + "IntelligentScissorsMB", + "setWeights", + "setGradientMagnitudeMaxLimit", + "setEdgeFeatureZeroCrossingParameters", + "setEdgeFeatureCannyParameters", + "applyImage", + "applyImageFeatures", + "buildMap", + "getContour" + ] } } diff --git a/modules/imgproc/perf/perf_intelligent_scissors.cpp b/modules/photo/perf/perf_intelligent_scissors.cpp similarity index 100% rename from modules/imgproc/perf/perf_intelligent_scissors.cpp rename to modules/photo/perf/perf_intelligent_scissors.cpp diff --git a/modules/imgproc/src/intelligent_scissors.cpp b/modules/photo/src/intelligent_scissors.cpp similarity index 100% rename from modules/imgproc/src/intelligent_scissors.cpp rename to modules/photo/src/intelligent_scissors.cpp diff --git a/modules/imgproc/test/test_intelligent_scissors.cpp b/modules/photo/test/test_intelligent_scissors.cpp similarity index 100% rename from modules/imgproc/test/test_intelligent_scissors.cpp rename to modules/photo/test/test_intelligent_scissors.cpp diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt index c353a072f8..04da5a93f8 100644 --- a/samples/cpp/CMakeLists.txt +++ b/samples/cpp/CMakeLists.txt @@ -24,8 +24,8 @@ if(NOT BUILD_EXAMPLES OR NOT OCV_DEPENDENCIES_FOUND) return() endif() -set(DEPS_example_snippet_imgproc_segmentation opencv_core opencv_imgproc) -set(DEPS_example_cpp_intelligent_scissors opencv_core opencv_imgproc opencv_imgcodecs opencv_highgui) +set(DEPS_example_snippet_imgproc_segmentation opencv_core opencv_photo) +set(DEPS_example_cpp_intelligent_scissors opencv_core opencv_photo opencv_imgcodecs opencv_highgui) project(cpp_samples) ocv_include_modules_recurse(${OPENCV_CPP_SAMPLES_REQUIRED_DEPS}) diff --git a/samples/cpp/tutorial_code/snippets/imgproc_segmentation.cpp b/samples/cpp/tutorial_code/snippets/photo_segmentation.cpp similarity index 92% rename from samples/cpp/tutorial_code/snippets/imgproc_segmentation.cpp rename to samples/cpp/tutorial_code/snippets/photo_segmentation.cpp index b81ba34494..1a71a1af44 100644 --- a/samples/cpp/tutorial_code/snippets/imgproc_segmentation.cpp +++ b/samples/cpp/tutorial_code/snippets/photo_segmentation.cpp @@ -1,5 +1,5 @@ -#include "opencv2/imgproc.hpp" -#include "opencv2/imgproc/segmentation.hpp" +#include "opencv2/photo.hpp" +#include "opencv2/photo/segmentation.hpp" using namespace cv;