diff --git a/modules/gpu/include/opencv2/gpu.hpp b/modules/gpu/include/opencv2/gpu.hpp index 10fbbd7d81..0466ac4729 100644 --- a/modules/gpu/include/opencv2/gpu.hpp +++ b/modules/gpu/include/opencv2/gpu.hpp @@ -55,6 +55,22 @@ namespace cv { namespace gpu { +//!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()); + //! removes points (CV_32FC2, single row matrix) with zero mask value CV_EXPORTS void compactPoints(GpuMat &points0, GpuMat &points1, const GpuMat &mask); diff --git a/modules/gpuimgproc/perf/perf_labeling.cpp b/modules/gpu/perf/perf_labeling.cpp similarity index 100% rename from modules/gpuimgproc/perf/perf_labeling.cpp rename to modules/gpu/perf/perf_labeling.cpp diff --git a/modules/gpuimgproc/src/cuda/ccomponetns.cu b/modules/gpu/src/cuda/ccomponetns.cu similarity index 100% rename from modules/gpuimgproc/src/cuda/ccomponetns.cu rename to modules/gpu/src/cuda/ccomponetns.cu diff --git a/modules/gpuimgproc/src/graphcuts.cpp b/modules/gpu/src/graphcuts.cpp similarity index 100% rename from modules/gpuimgproc/src/graphcuts.cpp rename to modules/gpu/src/graphcuts.cpp diff --git a/modules/gpuimgproc/test/test_labeling.cpp b/modules/gpu/test/test_labeling.cpp similarity index 100% rename from modules/gpuimgproc/test/test_labeling.cpp rename to modules/gpu/test/test_labeling.cpp diff --git a/modules/gpuimgproc/include/opencv2/gpuimgproc.hpp b/modules/gpuimgproc/include/opencv2/gpuimgproc.hpp index 8d15334469..5bfaa3b5c6 100644 --- a/modules/gpuimgproc/include/opencv2/gpuimgproc.hpp +++ b/modules/gpuimgproc/include/opencv2/gpuimgproc.hpp @@ -223,22 +223,6 @@ private: CannyBuf cannyBuf_; }; -//!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()); - //! Compute levels with even distribution. levels will have 1 row and nLevels cols and CV_32SC1 type. CV_EXPORTS void evenLevels(GpuMat& levels, int nLevels, int lowerLevel, int upperLevel); //! Calculates histogram with evenly distributed bins for signle channel source.