diff --git a/modules/cuda/include/opencv2/cuda.hpp b/modules/cuda/include/opencv2/cuda.hpp index c6004296b..b8f2ed715 100644 --- a/modules/cuda/include/opencv2/cuda.hpp +++ b/modules/cuda/include/opencv2/cuda.hpp @@ -58,29 +58,6 @@ namespace cv { namespace cuda { -//////////////////////////// Labeling //////////////////////////// - -//! @addtogroup cuda -//! @{ - -//!performs labeling via graph cuts of a 2D regular 4-connected graph. -CV_EXPORTS void graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTransp, GpuMat& top, GpuMat& bottom, GpuMat& labels, - GpuMat& buf, Stream& stream = Stream::Null()); - -//!performs labeling via graph cuts of a 2D regular 8-connected graph. -CV_EXPORTS void graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTransp, GpuMat& top, GpuMat& topLeft, GpuMat& topRight, - GpuMat& bottom, GpuMat& bottomLeft, GpuMat& bottomRight, - GpuMat& labels, - GpuMat& buf, Stream& stream = Stream::Null()); - -//! compute mask for Generalized Flood fill componetns labeling. -CV_EXPORTS void connectivityMask(const GpuMat& image, GpuMat& mask, const cv::Scalar& lo, const cv::Scalar& hi, Stream& stream = Stream::Null()); - -//! performs connected componnents labeling. -CV_EXPORTS void labelComponents(const GpuMat& mask, GpuMat& components, int flags = 0, Stream& stream = Stream::Null()); - -//! @} - //////////////////////////// Calib3d //////////////////////////// //! @addtogroup cuda_calib3d diff --git a/modules/cudalegacy/include/opencv2/cudalegacy.hpp b/modules/cudalegacy/include/opencv2/cudalegacy.hpp index f0107499d..18f55eba7 100644 --- a/modules/cudalegacy/include/opencv2/cudalegacy.hpp +++ b/modules/cudalegacy/include/opencv2/cudalegacy.hpp @@ -63,6 +63,10 @@ namespace cv { namespace cuda { //! @addtogroup cudalegacy //! @{ +// +// ImagePyramid +// + class CV_EXPORTS ImagePyramid : public Algorithm { public: @@ -227,6 +231,26 @@ CV_EXPORTS void interpolateFrames(const GpuMat& frame0, const GpuMat& frame1, CV_EXPORTS void createOpticalFlowNeedleMap(const GpuMat& u, const GpuMat& v, GpuMat& vertex, GpuMat& colors); +// +// Labeling +// + +//!performs labeling via graph cuts of a 2D regular 4-connected graph. +CV_EXPORTS void graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTransp, GpuMat& top, GpuMat& bottom, GpuMat& labels, + GpuMat& buf, Stream& stream = Stream::Null()); + +//!performs labeling via graph cuts of a 2D regular 8-connected graph. +CV_EXPORTS void graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTransp, GpuMat& top, GpuMat& topLeft, GpuMat& topRight, + GpuMat& bottom, GpuMat& bottomLeft, GpuMat& bottomRight, + GpuMat& labels, + GpuMat& buf, Stream& stream = Stream::Null()); + +//! compute mask for Generalized Flood fill componetns labeling. +CV_EXPORTS void connectivityMask(const GpuMat& image, GpuMat& mask, const cv::Scalar& lo, const cv::Scalar& hi, Stream& stream = Stream::Null()); + +//! performs connected componnents labeling. +CV_EXPORTS void labelComponents(const GpuMat& mask, GpuMat& components, int flags = 0, Stream& stream = Stream::Null()); + //! @} }} diff --git a/modules/cuda/perf/perf_labeling.cpp b/modules/cudalegacy/perf/perf_labeling.cpp similarity index 100% rename from modules/cuda/perf/perf_labeling.cpp rename to modules/cudalegacy/perf/perf_labeling.cpp diff --git a/modules/cuda/src/cuda/ccomponetns.cu b/modules/cudalegacy/src/cuda/ccomponetns.cu similarity index 100% rename from modules/cuda/src/cuda/ccomponetns.cu rename to modules/cudalegacy/src/cuda/ccomponetns.cu diff --git a/modules/cuda/src/graphcuts.cpp b/modules/cudalegacy/src/graphcuts.cpp similarity index 100% rename from modules/cuda/src/graphcuts.cpp rename to modules/cudalegacy/src/graphcuts.cpp diff --git a/modules/cuda/test/test_labeling.cpp b/modules/cudalegacy/test/test_labeling.cpp similarity index 100% rename from modules/cuda/test/test_labeling.cpp rename to modules/cudalegacy/test/test_labeling.cpp diff --git a/modules/stitching/CMakeLists.txt b/modules/stitching/CMakeLists.txt index 36d4452c7..827675405 100644 --- a/modules/stitching/CMakeLists.txt +++ b/modules/stitching/CMakeLists.txt @@ -5,4 +5,4 @@ if(HAVE_CUDA) endif() ocv_define_module(stitching opencv_imgproc opencv_features2d opencv_calib3d opencv_objdetect - OPTIONAL opencv_cuda opencv_cudaarithm opencv_cudafilters opencv_cudafeatures2d opencv_xfeatures2d) + OPTIONAL opencv_cuda opencv_cudaarithm opencv_cudafilters opencv_cudafeatures2d opencv_cudalegacy opencv_xfeatures2d) diff --git a/modules/stitching/include/opencv2/stitching/detail/seam_finders.hpp b/modules/stitching/include/opencv2/stitching/detail/seam_finders.hpp index e4f7816bb..37029215e 100644 --- a/modules/stitching/include/opencv2/stitching/detail/seam_finders.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/seam_finders.hpp @@ -249,7 +249,7 @@ private: }; -#ifdef HAVE_OPENCV_CUDA +#ifdef HAVE_OPENCV_CUDALEGACY class CV_EXPORTS GraphCutSeamFinderGpu : public GraphCutSeamFinderBase, public PairwiseSeamFinder { public: diff --git a/modules/stitching/src/precomp.hpp b/modules/stitching/src/precomp.hpp index c70d9f9a4..70636b684 100644 --- a/modules/stitching/src/precomp.hpp +++ b/modules/stitching/src/precomp.hpp @@ -83,8 +83,8 @@ # include "opencv2/cudafeatures2d.hpp" #endif -#ifdef HAVE_OPENCV_CUDA -# include "opencv2/cuda.hpp" +#ifdef HAVE_OPENCV_CUDALEGACY +# include "opencv2/cudalegacy.hpp" #endif #ifdef HAVE_OPENCV_XFEATURES2D diff --git a/modules/stitching/src/seam_finders.cpp b/modules/stitching/src/seam_finders.cpp index 4d5c8d163..8a673ede0 100644 --- a/modules/stitching/src/seam_finders.cpp +++ b/modules/stitching/src/seam_finders.cpp @@ -1321,7 +1321,7 @@ void GraphCutSeamFinder::find(const std::vector &src, const std::vector &src, const std::vector &corners, std::vector &masks) {