From cad9518928f673ffaf5adb4e7cd1067be96c485d Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Wed, 17 Apr 2013 18:16:34 +0400 Subject: [PATCH] moved image labeling to gpu module --- modules/gpu/include/opencv2/gpu.hpp | 16 ++++++++++++++++ modules/{gpuimgproc => gpu}/perf/perf_labeling.cpp | 0 modules/{gpuimgproc => gpu}/src/cuda/ccomponetns.cu | 0 modules/{gpuimgproc => gpu}/src/graphcuts.cpp | 0 modules/{gpuimgproc => gpu}/test/test_labeling.cpp | 0 modules/gpuimgproc/include/opencv2/gpuimgproc.hpp | 16 ---------------- 6 files changed, 16 insertions(+), 16 deletions(-) rename modules/{gpuimgproc => gpu}/perf/perf_labeling.cpp (100%) rename modules/{gpuimgproc => gpu}/src/cuda/ccomponetns.cu (100%) rename modules/{gpuimgproc => gpu}/src/graphcuts.cpp (100%) rename modules/{gpuimgproc => gpu}/test/test_labeling.cpp (100%) diff --git a/modules/gpu/include/opencv2/gpu.hpp b/modules/gpu/include/opencv2/gpu.hpp index 10fbbd7..0466ac4 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 8d15334..5bfaa3b 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. -- 2.7.4