GPU module update: _GPU suffix removed, some namespaces renamed, minor refactorings.
authorKirill Kornyakov <no@email>
Mon, 6 Sep 2010 14:27:23 +0000 (14:27 +0000)
committerKirill Kornyakov <no@email>
Mon, 6 Sep 2010 14:27:23 +0000 (14:27 +0000)
15 files changed:
modules/gpu/include/opencv2/gpu/gpu.hpp
modules/gpu/src/cuda/beliefpropagation.cu
modules/gpu/src/cuda/bilateral_filter.cu
modules/gpu/src/cuda/color.cu
modules/gpu/src/cuda/constantspacebp.cu
modules/gpu/src/cuda/cuda_shared.hpp
modules/gpu/src/cuda/imgproc.cu
modules/gpu/src/cuda/matrix_operations.cu
modules/gpu/src/cuda/stereobm.cu
modules/gpu/src/cudastream.cpp
modules/gpu/src/imgproc_gpu.cpp
modules/gpu/src/matrix_operations.cpp
modules/gpu/src/stereobm_gpu.cpp
tests/gpu/src/meanshift.cpp
tests/gpu/src/stereo_bm.cpp

index f439a37..44ad9d2 100644 (file)
@@ -344,10 +344,10 @@ namespace cv
         ////////////////////////////// Image processing //////////////////////////////\r
         // DST[x,y] = SRC[xmap[x,y],ymap[x,y]] with bilinear interpolation.\r
         // xymap.type() == xymap.type() == CV_32FC1\r
-        CV_EXPORTS void remap(const GpuMat& src, const GpuMat& xmap, const GpuMat& ymap, GpuMat& dst);\r
+        CV_EXPORTS void remap(const GpuMat& src, GpuMat& dst, const GpuMat& xmap, const GpuMat& ymap);\r
 \r
         // Does mean shift filtering on GPU.\r
-        CV_EXPORTS void meanShiftFiltering_GPU(const GpuMat& src, GpuMat& dst, int sp, int sr, \r
+        CV_EXPORTS void meanShiftFiltering(const GpuMat& src, GpuMat& dst, int sp, int sr, \r
             TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 5, 1));\r
 \r
         // Does coloring of disparity image: [0..ndisp) -> [0..240, 1, 1] in HSV.\r
@@ -362,18 +362,18 @@ namespace cv
         // The output is a 4-channel floating-point (CV_32FC4) matrix. \r
         // Each element of this matrix will contain the 3D coordinates of the point (x,y,z,1), computed from the disparity map.\r
         // Q is the 4x4 perspective transformation matrix that can be obtained with cvStereoRectify.\r
-        CV_EXPORTS void reprojectImageTo3D_GPU(const GpuMat& disp, GpuMat& xyzw, const Mat& Q);\r
+        CV_EXPORTS void reprojectImageTo3D(const GpuMat& disp, GpuMat& xyzw, const Mat& Q);\r
         // Acync version\r
-        CV_EXPORTS void reprojectImageTo3D_GPU(const GpuMat& disp, GpuMat& xyzw, const Mat& Q, const Stream& stream);\r
+        CV_EXPORTS void reprojectImageTo3D(const GpuMat& disp, GpuMat& xyzw, const Mat& Q, const Stream& stream);\r
 \r
-        CV_EXPORTS void cvtColor_GPU(const GpuMat& src, GpuMat& dst, int code, int dcn = 0);\r
-        CV_EXPORTS void cvtColor_GPU(const GpuMat& src, GpuMat& dst, int code, int dcn, const Stream& stream);\r
+        CV_EXPORTS void cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn = 0);\r
+        CV_EXPORTS void cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn, const Stream& stream);\r
 \r
         //////////////////////////////// StereoBM_GPU ////////////////////////////////\r
 \r
         class CV_EXPORTS StereoBM_GPU\r
         {\r
-        public:\r
+        public:                                    \r
             enum { BASIC_PRESET = 0, PREFILTER_XSOBEL = 1 };\r
 \r
             enum { DEFAULT_NDISP = 64, DEFAULT_WINSZ = 19 };\r
index ddf5bd3..063a9ad 100644 (file)
@@ -45,7 +45,6 @@
 #include "safe_call.hpp"\r
 \r
 using namespace cv::gpu;\r
-using namespace cv::gpu::impl;\r
 \r
 #ifndef FLT_MAX\r
 #define FLT_MAX 3.402823466e+38F\r
index 9eca3f4..132ca84 100644 (file)
@@ -45,7 +45,6 @@
 #include "safe_call.hpp"\r
 \r
 using namespace cv::gpu;\r
-using namespace cv::gpu::impl;\r
 \r
 #ifndef FLT_MAX\r
 #define FLT_MAX 3.402823466e+30F\r
index b14a1b0..a53a4f8 100644 (file)
@@ -44,7 +44,6 @@
 #include "saturate_cast.hpp"\r
 \r
 using namespace cv::gpu;\r
-using namespace cv::gpu::impl;\r
 \r
 #ifndef CV_DESCALE\r
 #define CV_DESCALE(x,n) (((x) + (1 << ((n)-1))) >> (n))\r
@@ -167,7 +166,7 @@ namespace imgproc
         }\r
 }\r
 \r
-namespace cv { namespace gpu { namespace impl\r
+namespace cv { namespace gpu { namespace improc\r
 {\r
     template <typename T>\r
     void RGB2RGB_caller(const DevMem2D_<T>& src, int srccn, const DevMem2D_<T>& dst, int dstcn, int bidx, cudaStream_t stream)\r
@@ -377,7 +376,7 @@ namespace imgproc
     //};\r
 }\r
 \r
-namespace cv { namespace gpu { namespace impl\r
+namespace cv { namespace gpu { namespace improc\r
 {\r
     template <typename T>\r
     void Gray2RGB_caller(const DevMem2D_<T>& src, const DevMem2D_<T>& dst, int dstcn, cudaStream_t stream)\r
@@ -627,7 +626,7 @@ namespace imgproc
     }\r
 }\r
 \r
-namespace cv { namespace gpu { namespace impl\r
+namespace cv { namespace gpu { namespace improc\r
 {\r
     void RGB2Gray_gpu(const DevMem2D& src, int srccn, const DevMem2D& dst, int bidx, cudaStream_t stream)\r
     {\r
index 48f4359..7be1179 100644 (file)
@@ -45,7 +45,6 @@
 #include "safe_call.hpp"\r
 \r
 using namespace cv::gpu;\r
-using namespace cv::gpu::impl;\r
 \r
 #ifndef FLT_MAX\r
 #define FLT_MAX 3.402823466e+30F\r
index 73304f5..449fcb0 100644 (file)
@@ -56,10 +56,10 @@ namespace cv
         typedef unsigned short ushort;\r
         typedef unsigned int uint;\r
 \r
-        namespace impl\r
-        {\r
-            static inline int divUp(int a, int b) { return (a % b == 0) ? a/b : a/b + 1; }\r
+        static inline int divUp(int a, int b) { return (a % b == 0) ? a/b : a/b + 1; }\r
 \r
+        namespace matrix_operations\r
+        {            \r
             extern "C" void copy_to_with_mask(const DevMem2D& src, DevMem2D dst, int depth, const DevMem2D& mask, int channels, const cudaStream_t & stream = 0);\r
 \r
             extern "C" void set_to_without_mask (DevMem2D dst, int depth, const double *scalar, int channels, const cudaStream_t & stream = 0);\r
index 5fc28d5..1dd4616 100644 (file)
@@ -123,7 +123,7 @@ namespace imgproc
     }\r
 }\r
 \r
-namespace cv { namespace gpu { namespace impl \r
+namespace cv { namespace gpu { namespace improc \r
 {\r
     void remap_gpu_1c(const DevMem2D& src, const DevMem2Df& xmap, const DevMem2Df& ymap, DevMem2D dst)\r
     {\r
@@ -231,7 +231,7 @@ namespace imgproc
     }\r
 }\r
 \r
-namespace cv { namespace gpu { namespace impl \r
+namespace cv { namespace gpu { namespace improc \r
 {\r
     extern "C" void meanShiftFiltering_gpu(const DevMem2D& src, DevMem2D dst, int sp, int sr, int maxIter, float eps)\r
     {                        \r
@@ -354,7 +354,7 @@ namespace imgproc
     }\r
 }\r
 \r
-namespace cv { namespace gpu { namespace impl \r
+namespace cv { namespace gpu { namespace improc \r
 {\r
     void drawColorDisp_gpu(const DevMem2D& src, const DevMem2D& dst, int ndisp, const cudaStream_t& stream)\r
     {\r
@@ -420,7 +420,7 @@ namespace imgproc
     }\r
 }\r
 \r
-namespace cv { namespace gpu { namespace impl \r
+namespace cv { namespace gpu { namespace improc \r
 {\r
     template <typename T>\r
     inline void reprojectImageTo3D_caller(const DevMem2D_<T>& disp, const DevMem2Df& xyzw, const float* q, const cudaStream_t& stream)\r
index fe730cc..e16e553 100644 (file)
@@ -47,7 +47,7 @@
 #include "saturate_cast.hpp"
 
 using namespace cv::gpu;
-using namespace cv::gpu::impl;
+using namespace cv::gpu::matrix_operations;
 
 
 namespace mat_operators
@@ -261,7 +261,7 @@ namespace cv
 {
     namespace gpu
     {
-        namespace impl
+        namespace matrix_operations
         {
 
             ///////////////////////////////////////////////////////////////////////////
index 91f3294..73a70b8 100644 (file)
@@ -316,7 +316,7 @@ __global__ void stereoKernel(unsigned char *left, unsigned char *right, size_t i
 }\r
 \r
 \r
-namespace cv { namespace gpu { namespace impl\r
+namespace cv { namespace gpu { namespace bm\r
 {\r
     template<int RADIUS> void kernel_caller(const DevMem2D& left, const DevMem2D& right, const DevMem2D& disp, int maxdisp, const cudaStream_t & stream)\r
     {\r
@@ -408,7 +408,7 @@ extern "C" __global__ void prefilter_kernel(unsigned char *output, size_t step,
 \r
 }\r
 \r
-namespace cv { namespace gpu  { namespace impl\r
+namespace cv { namespace gpu  { namespace bm\r
 {\r
     extern "C" void prefilter_xsobel(const DevMem2D& input, const DevMem2D& output, int prefilterCap)\r
     {\r
@@ -530,7 +530,7 @@ extern "C" __global__ void textureness_kernel(unsigned char *disp, size_t disp_s
 }\r
 }\r
 \r
-namespace cv { namespace gpu  { namespace impl\r
+namespace cv { namespace gpu  { namespace bm\r
 {\r
     extern "C" void postfilter_textureness(const DevMem2D& input, int winsz, float avgTexturenessThreshold, const DevMem2D& disp)\r
     {\r
index df0a696..f933453 100644 (file)
@@ -158,12 +158,12 @@ void cv::gpu::Stream::enqueueCopy(const GpuMat& src, GpuMat& dst) { devcopy(src,
 \r
 void cv::gpu::Stream::enqueueMemSet(const GpuMat& src, Scalar val)\r
 {\r
-    impl::set_to_without_mask(src, src.depth(), val.val, src.channels(), impl->stream);\r
+    matrix_operations::set_to_without_mask(src, src.depth(), val.val, src.channels(), impl->stream);\r
 }\r
 \r
 void cv::gpu::Stream::enqueueMemSet(const GpuMat& src, Scalar val, const GpuMat& mask)\r
 {\r
-    impl::set_to_with_mask(src, src.depth(), val.val, mask, src.channels(), impl->stream);\r
+    matrix_operations::set_to_with_mask(src, src.depth(), val.val, mask, src.channels(), impl->stream);\r
 }\r
 \r
 void cv::gpu::Stream::enqueueConvert(const GpuMat& src, GpuMat& dst, int rtype, double alpha, double beta)\r
@@ -188,7 +188,7 @@ void cv::gpu::Stream::enqueueConvert(const GpuMat& src, GpuMat& dst, int rtype,
         psrc = &(temp = src);\r
 \r
     dst.create( src.size(), rtype );\r
-    impl::convert_to(*psrc, sdepth, dst, ddepth, psrc->channels(), alpha, beta, impl->stream);\r
+    matrix_operations::convert_to(*psrc, sdepth, dst, ddepth, psrc->channels(), alpha, beta, impl->stream);\r
 }\r
 \r
 \r
index e9e7d33..719f106 100644 (file)
@@ -47,20 +47,20 @@ using namespace cv::gpu;
 \r
 #if !defined (HAVE_CUDA)\r
 \r
-void cv::gpu::remap(const GpuMat&, const GpuMat&, const GpuMat&, GpuMat&) { throw_nogpu(); }\r
-void cv::gpu::meanShiftFiltering_GPU(const GpuMat&, GpuMat&, int, int, TermCriteria ) { throw_nogpu(); }\r
+void cv::gpu::remap( const GpuMat& src, GpuMat& dst, const GpuMat& xmap, const GpuMat& ymap ){ throw_nogpu(); }\r
+void cv::gpu::meanShiftFiltering(const GpuMat&, GpuMat&, int, int, TermCriteria ) { throw_nogpu(); }\r
 void cv::gpu::drawColorDisp(const GpuMat&, GpuMat&, int) { throw_nogpu(); }\r
 void cv::gpu::drawColorDisp(const GpuMat&, GpuMat&, int, const Stream&) { throw_nogpu(); }\r
-void cv::gpu::reprojectImageTo3D_GPU(const GpuMat&, GpuMat&, const Mat&) { throw_nogpu(); }\r
-void cv::gpu::reprojectImageTo3D_GPU(const GpuMat&, GpuMat&, const Mat&, const Stream&) { throw_nogpu(); }\r
-void cv::gpu::cvtColor_GPU(const GpuMat&, GpuMat&, int, int) { throw_nogpu(); }\r
-void cv::gpu::cvtColor_GPU(const GpuMat&, GpuMat&, int, int, const Stream&) { throw_nogpu(); }\r
+void cv::gpu::reprojectImageTo3D(const GpuMat&, GpuMat&, const Mat&) { throw_nogpu(); }\r
+void cv::gpu::reprojectImageTo3D(const GpuMat&, GpuMat&, const Mat&, const Stream&) { throw_nogpu(); }\r
+void cv::gpu::cvtColor(const GpuMat&, GpuMat&, int, int) { throw_nogpu(); }\r
+void cv::gpu::cvtColor(const GpuMat&, GpuMat&, int, int, const Stream&) { throw_nogpu(); }\r
 \r
 #else /* !defined (HAVE_CUDA) */\r
 \r
 namespace cv { namespace gpu \r
 { \r
-    namespace impl \r
+    namespace improc \r
     {\r
         void remap_gpu_1c(const DevMem2D& src, const DevMem2Df& xmap, const DevMem2Df& ymap, DevMem2D dst);\r
         void remap_gpu_3c(const DevMem2D& src, const DevMem2Df& xmap, const DevMem2Df& ymap, DevMem2D dst);\r
@@ -90,10 +90,10 @@ namespace cv { namespace gpu
 ////////////////////////////////////////////////////////////////////////\r
 // remap\r
 \r
-void cv::gpu::remap(const GpuMat& src, const GpuMat& xmap, const GpuMat& ymap, GpuMat& dst)\r
+void cv::gpu::remap(const GpuMat& src, GpuMat& dst, const GpuMat& xmap, const GpuMat& ymap)\r
 {\r
     typedef void (*remap_gpu_t)(const DevMem2D& src, const DevMem2Df& xmap, const DevMem2Df& ymap, DevMem2D dst);\r
-    static const remap_gpu_t callers[] = {impl::remap_gpu_1c, 0, impl::remap_gpu_3c};\r
+    static const remap_gpu_t callers[] = {improc::remap_gpu_1c, 0, improc::remap_gpu_3c};\r
 \r
     CV_Assert((src.type() == CV_8U || src.type() == CV_8UC3) && xmap.type() == CV_32F && ymap.type() == CV_32F);\r
 \r
@@ -111,7 +111,7 @@ void cv::gpu::remap(const GpuMat& src, const GpuMat& xmap, const GpuMat& ymap, G
 ////////////////////////////////////////////////////////////////////////\r
 // meanShiftFiltering_GPU\r
 \r
-void cv::gpu::meanShiftFiltering_GPU(const GpuMat& src, GpuMat& dst, int sp, int sr, TermCriteria criteria)\r
+void cv::gpu::meanShiftFiltering(const GpuMat& src, GpuMat& dst, int sp, int sr, TermCriteria criteria)\r
 {       \r
     if( src.empty() )\r
         CV_Error( CV_StsBadArg, "The input image is empty" );\r
@@ -131,7 +131,7 @@ void cv::gpu::meanShiftFiltering_GPU(const GpuMat& src, GpuMat& dst, int sp, int
         eps = 1.f;\r
     eps = (float)std::max(criteria.epsilon, 0.0);        \r
 \r
-    impl::meanShiftFiltering_gpu(src, dst, sp, sr, maxIter, eps);    \r
+    improc::meanShiftFiltering_gpu(src, dst, sp, sr, maxIter, eps);    \r
 }\r
 \r
 ////////////////////////////////////////////////////////////////////////\r
@@ -147,7 +147,7 @@ namespace
             out = dst;\r
         out.create(src.size(), CV_8UC4);\r
 \r
-        impl::drawColorDisp_gpu((DevMem2D_<T>)src, out, ndisp, stream);\r
+        improc::drawColorDisp_gpu((DevMem2D_<T>)src, out, ndisp, stream);\r
 \r
         dst = out;\r
     }\r
@@ -180,7 +180,7 @@ namespace
     void reprojectImageTo3D_caller(const GpuMat& disp, GpuMat& xyzw, const Mat& Q, const cudaStream_t& stream)\r
     {        \r
         xyzw.create(disp.rows, disp.cols, CV_32FC4);\r
-        impl::reprojectImageTo3D_gpu((DevMem2D_<T>)disp, xyzw, Q.ptr<float>(), stream);\r
+        improc::reprojectImageTo3D_gpu((DevMem2D_<T>)disp, xyzw, Q.ptr<float>(), stream);\r
     }\r
     \r
     typedef void (*reprojectImageTo3D_caller_t)(const GpuMat& disp, GpuMat& xyzw, const Mat& Q, const cudaStream_t& stream);\r
@@ -188,14 +188,14 @@ namespace
     const reprojectImageTo3D_caller_t reprojectImageTo3D_callers[] = {reprojectImageTo3D_caller<unsigned char>, 0, 0, reprojectImageTo3D_caller<short>, 0, 0, 0, 0};\r
 }\r
 \r
-void cv::gpu::reprojectImageTo3D_GPU(const GpuMat& disp, GpuMat& xyzw, const Mat& Q)\r
+void cv::gpu::reprojectImageTo3D(const GpuMat& disp, GpuMat& xyzw, const Mat& Q)\r
 {\r
     CV_Assert((disp.type() == CV_8U || disp.type() == CV_16S) && Q.type() == CV_32F && Q.rows == 4 && Q.cols == 4);\r
     \r
     reprojectImageTo3D_callers[disp.type()](disp, xyzw, Q, 0);\r
 }\r
 \r
-void cv::gpu::reprojectImageTo3D_GPU(const GpuMat& disp, GpuMat& xyzw, const Mat& Q, const Stream& stream)\r
+void cv::gpu::reprojectImageTo3D(const GpuMat& disp, GpuMat& xyzw, const Mat& Q, const Stream& stream)\r
 {\r
     CV_Assert((disp.type() == CV_8U || disp.type() == CV_16S) && Q.type() == CV_32F && Q.rows == 4 && Q.cols == 4);\r
     \r
@@ -229,11 +229,11 @@ namespace
                 \r
                 out.create(sz, CV_MAKETYPE(depth, dcn));\r
                 if( depth == CV_8U )\r
-                    impl::RGB2RGB_gpu((DevMem2D)src, scn, (DevMem2D)out, dcn, bidx, stream);\r
+                    improc::RGB2RGB_gpu((DevMem2D)src, scn, (DevMem2D)out, dcn, bidx, stream);\r
                 else if( depth == CV_16U )\r
-                    impl::RGB2RGB_gpu((DevMem2D_<unsigned short>)src, scn, (DevMem2D_<unsigned short>)out, dcn, bidx, stream);\r
+                    improc::RGB2RGB_gpu((DevMem2D_<unsigned short>)src, scn, (DevMem2D_<unsigned short>)out, dcn, bidx, stream);\r
                 else\r
-                    impl::RGB2RGB_gpu((DevMem2Df)src, scn, (DevMem2Df)out, dcn, bidx, stream);\r
+                    improc::RGB2RGB_gpu((DevMem2Df)src, scn, (DevMem2Df)out, dcn, bidx, stream);\r
                 break;\r
                 \r
             //case CV_BGR2BGR565: case CV_BGR2BGR555: case CV_RGB2BGR565: case CV_RGB2BGR555:\r
@@ -270,11 +270,11 @@ namespace
                 bidx = code == CV_BGR2GRAY || code == CV_BGRA2GRAY ? 0 : 2;\r
                 \r
                 if( depth == CV_8U )\r
-                    impl::RGB2Gray_gpu((DevMem2D)src, scn, (DevMem2D)out, bidx, stream);\r
+                    improc::RGB2Gray_gpu((DevMem2D)src, scn, (DevMem2D)out, bidx, stream);\r
                 else if( depth == CV_16U )\r
-                    impl::RGB2Gray_gpu((DevMem2D_<unsigned short>)src, scn, (DevMem2D_<unsigned short>)out, bidx, stream);\r
+                    improc::RGB2Gray_gpu((DevMem2D_<unsigned short>)src, scn, (DevMem2D_<unsigned short>)out, bidx, stream);\r
                 else\r
-                    impl::RGB2Gray_gpu((DevMem2Df)src, scn, (DevMem2Df)out, bidx, stream);\r
+                    improc::RGB2Gray_gpu((DevMem2Df)src, scn, (DevMem2Df)out, bidx, stream);\r
                 break;\r
             \r
             //case CV_BGR5652GRAY: case CV_BGR5552GRAY:\r
@@ -291,11 +291,11 @@ namespace
                 out.create(sz, CV_MAKETYPE(depth, dcn));\r
                 \r
                 if( depth == CV_8U )\r
-                    impl::Gray2RGB_gpu((DevMem2D)src, (DevMem2D)out, dcn, stream);\r
+                    improc::Gray2RGB_gpu((DevMem2D)src, (DevMem2D)out, dcn, stream);\r
                 else if( depth == CV_16U )\r
-                    impl::Gray2RGB_gpu((DevMem2D_<unsigned short>)src, (DevMem2D_<unsigned short>)out, dcn, stream);\r
+                    improc::Gray2RGB_gpu((DevMem2D_<unsigned short>)src, (DevMem2D_<unsigned short>)out, dcn, stream);\r
                 else\r
-                    impl::Gray2RGB_gpu((DevMem2Df)src, (DevMem2Df)out, dcn, stream);\r
+                    improc::Gray2RGB_gpu((DevMem2Df)src, (DevMem2Df)out, dcn, stream);\r
                 break;\r
                 \r
             //case CV_GRAY2BGR565: case CV_GRAY2BGR555:\r
@@ -516,12 +516,12 @@ namespace
     }\r
 }\r
 \r
-void cv::gpu::cvtColor_GPU(const GpuMat& src, GpuMat& dst, int code, int dcn)\r
+void cv::gpu::cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn)\r
 {\r
     cvtColor_caller(src, dst, code, dcn, 0);\r
 }\r
 \r
-void cv::gpu::cvtColor_GPU(const GpuMat& src, GpuMat& dst, int code, int dcn, const Stream& stream)\r
+void cv::gpu::cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn, const Stream& stream)\r
 {\r
     cvtColor_caller(src, dst, code, dcn, StreamAccessor::getStream(stream));\r
 }\r
index b075d80..97c1f10 100644 (file)
@@ -120,7 +120,7 @@ void cv::gpu::GpuMat::copyTo( GpuMat& mat, const GpuMat& mask ) const
     else\r
     {\r
         mat.create(size(), type());\r
-        cv::gpu::impl::copy_to_with_mask(*this, mat, depth(), mask, channels());\r
+        cv::gpu::matrix_operations::copy_to_with_mask(*this, mat, depth(), mask, channels());\r
     }\r
 }\r
 \r
@@ -146,12 +146,12 @@ void cv::gpu::GpuMat::convertTo( GpuMat& dst, int rtype, double alpha, double be
         psrc = &(temp = *this);\r
 \r
     dst.create( size(), rtype );\r
-    impl::convert_to(*psrc, sdepth, dst, ddepth, psrc->channels(), alpha, beta);\r
+    matrix_operations::convert_to(*psrc, sdepth, dst, ddepth, psrc->channels(), alpha, beta);\r
 }\r
 \r
 GpuMat& GpuMat::operator = (const Scalar& s)\r
 {\r
-    impl::set_to_without_mask( *this, depth(), s.val, channels());\r
+    matrix_operations::set_to_without_mask( *this, depth(), s.val, channels());\r
     return *this;\r
 }\r
 \r
@@ -162,9 +162,9 @@ GpuMat& GpuMat::setTo(const Scalar& s, const GpuMat& mask)
     CV_DbgAssert(!this->empty());\r
 \r
     if (mask.empty())\r
-        impl::set_to_without_mask( *this, depth(), s.val, channels());\r
+        matrix_operations::set_to_without_mask( *this, depth(), s.val, channels());\r
     else\r
-        impl::set_to_with_mask( *this, depth(), s.val, mask, channels());\r
+        matrix_operations::set_to_with_mask( *this, depth(), s.val, mask, channels());\r
 \r
     return *this;\r
 }\r
index 060a63b..1c5716f 100644 (file)
@@ -58,7 +58,7 @@ void cv::gpu::StereoBM_GPU::operator() ( const GpuMat&, const GpuMat&, GpuMat&,
 \r
 namespace cv { namespace gpu\r
 {\r
-    namespace impl\r
+    namespace bm\r
     {\r
         //extern "C" void stereoBM_GPU(const DevMem2D& left, const DevMem2D& right, const DevMem2D& disp, int ndisp, int winsz, const DevMem2D_<uint>& minSSD_buf);\r
         extern "C" void stereoBM_GPU(const DevMem2D& left, const DevMem2D& right, const DevMem2D& disp, int ndisp, int winsz, const DevMem2D_<uint>& minSSD_buf, const cudaStream_t & stream);\r
@@ -115,17 +115,17 @@ static void stereo_bm_gpu_operator ( GpuMat& minSSD,  GpuMat& leBuf, GpuMat&  ri
         leBuf.create( left.size(),  left.type());\r
         riBuf.create(right.size(), right.type());\r
 \r
-        impl::prefilter_xsobel( left, leBuf);\r
-        impl::prefilter_xsobel(right, riBuf);\r
+        bm::prefilter_xsobel( left, leBuf);\r
+        bm::prefilter_xsobel(right, riBuf);\r
 \r
         le_for_bm = leBuf;\r
         ri_for_bm = riBuf;\r
     }\r
 \r
-    impl::stereoBM_GPU(le_for_bm, ri_for_bm, disparity, ndisp, winSize, minSSD, stream);\r
+    bm::stereoBM_GPU(le_for_bm, ri_for_bm, disparity, ndisp, winSize, minSSD, stream);\r
 \r
     if (avergeTexThreshold)\r
-        impl::postfilter_textureness(le_for_bm, winSize, avergeTexThreshold, disparity);\r
+        bm::postfilter_textureness(le_for_bm, winSize, avergeTexThreshold, disparity);\r
 }\r
 \r
 \r
index 072af98..e5443c7 100644 (file)
@@ -76,7 +76,7 @@ void CV_GpuMeanShiftTest::run(int)
         cvtColor(img, rgba, CV_BGR2BGRA);\r
 \r
         cv::gpu::GpuMat res;\r
-        cv::gpu::meanShiftFiltering_GPU( cv::gpu::GpuMat(rgba), res, spatialRad, colorRad );\r
+        cv::gpu::meanShiftFiltering( cv::gpu::GpuMat(rgba), res, spatialRad, colorRad );\r
         if (res.type() != CV_8UC4)\r
         {\r
             ts->set_failed_test_info(CvTS::FAIL_INVALID_OUTPUT);\r
index 45de01e..8631c57 100644 (file)
@@ -51,6 +51,7 @@ class CV_GpuStereoBMTest : public CvTest
 {
 public:
        CV_GpuStereoBMTest();
+
 protected:
        void run(int);
 };
@@ -61,9 +62,9 @@ void CV_GpuStereoBMTest::run(int )
 {
        cv::Mat img_l = cv::imread(std::string(ts->get_data_path()) + "stereobm/aloe-L.png", 0);
        cv::Mat img_r = cv::imread(std::string(ts->get_data_path()) + "stereobm/aloe-R.png", 0);
-       cv::Mat img_template = cv::imread(std::string(ts->get_data_path()) + "stereobm/aloe-disp.png", 0);
+       cv::Mat img_reference = cv::imread(std::string(ts->get_data_path()) + "stereobm/aloe-disp.png", 0);
 
-    if (img_l.empty() || img_r.empty() || img_template.empty())
+    if (img_l.empty() || img_r.empty() || img_reference.empty())
     {
         ts->set_failed_test_info(CvTS::FAIL_MISSING_TEST_DATA);
         return;
@@ -71,14 +72,11 @@ void CV_GpuStereoBMTest::run(int )
 
        cv::gpu::GpuMat disp;
        cv::gpu::StereoBM_GPU bm(0, 128, 19);
-
        bm(cv::gpu::GpuMat(img_l), cv::gpu::GpuMat(img_r), disp);
 
-       //cv::imwrite(std::string(ts->get_data_path()) + "stereobm/aloe-disp.png", disp);
-
-       disp.convertTo(disp, img_template.type());
+       disp.convertTo(disp, img_reference.type());
+       double norm = cv::norm(disp, img_reference, cv::NORM_INF);
 
-       double norm = cv::norm(disp, img_template, cv::NORM_INF);
        if (norm >= 100) 
         ts->printf(CvTS::CONSOLE, "\nStereoBM norm = %f\n", norm);
        ts->set_failed_test_info((norm < 100) ? CvTS::OK : CvTS::FAIL_GENERIC);