From bf6c08a9ea4222d6103a8a454eb1b43877725568 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Thu, 4 Apr 2013 11:00:36 +0400 Subject: [PATCH] fixed compilation with CUDA --- modules/core/src/matrix_operations.cpp | 2 +- modules/gpu/test/test_bgfg.cpp | 4 ++-- modules/gpu/test/test_precomp.hpp | 2 ++ modules/highgui/src/window_gtk.cpp | 5 +---- modules/nonfree/src/precomp.hpp | 1 + modules/superres/src/precomp.hpp | 1 + 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/core/src/matrix_operations.cpp b/modules/core/src/matrix_operations.cpp index 243d56e..53764a1 100644 --- a/modules/core/src/matrix_operations.cpp +++ b/modules/core/src/matrix_operations.cpp @@ -224,7 +224,7 @@ void cv::gpu::CudaMem::create(int _rows, int _cols, int _type, int _alloc_type) if (_alloc_type == ALLOC_ZEROCOPY && !canMapHostMemory()) cv::gpu::error("ZeroCopy is not supported by current device", __FILE__, __LINE__); - _type &= TYPE_MASK; + _type &= Mat::TYPE_MASK; if( rows == _rows && cols == _cols && type() == _type && data ) return; if( data ) diff --git a/modules/gpu/test/test_bgfg.cpp b/modules/gpu/test/test_bgfg.cpp index 3ed9360..0ffd8d1 100644 --- a/modules/gpu/test/test_bgfg.cpp +++ b/modules/gpu/test/test_bgfg.cpp @@ -125,8 +125,8 @@ GPU_TEST_P(FGDStatModel, Update) ASSERT_EQ(gold_count, count); - cv::Mat gold_background(model->background); - cv::Mat gold_foreground(model->foreground); + cv::Mat gold_background = cv::cvarrToMat(model->background); + cv::Mat gold_foreground = cv::cvarrToMat(model->foreground); if (out_cn == 3) d_model.background.download(h_background3); diff --git a/modules/gpu/test/test_precomp.hpp b/modules/gpu/test/test_precomp.hpp index c036586..f2657f0 100644 --- a/modules/gpu/test/test_precomp.hpp +++ b/modules/gpu/test/test_precomp.hpp @@ -64,6 +64,8 @@ #include #include +#include "opencv2/core/private.hpp" + #ifdef HAVE_CUDA #include #include diff --git a/modules/highgui/src/window_gtk.cpp b/modules/highgui/src/window_gtk.cpp index 82a69b6..82c4977 100644 --- a/modules/highgui/src/window_gtk.cpp +++ b/modules/highgui/src/window_gtk.cpp @@ -1096,10 +1096,7 @@ cvShowImage( const char* name, const CvArr* arr ) #ifdef HAVE_OPENGL if (window->useGl) { - CvMat stub; - CvMat* mat = cvGetMat(arr, &stub); - cv::Mat im(mat); - cv::imshow(name, im); + cv::imshow(name, cv::cvarrToMat(arr)); return; } #endif diff --git a/modules/nonfree/src/precomp.hpp b/modules/nonfree/src/precomp.hpp index 424c716..1cbb36d 100644 --- a/modules/nonfree/src/precomp.hpp +++ b/modules/nonfree/src/precomp.hpp @@ -47,6 +47,7 @@ #include "opencv2/imgproc.hpp" #include "opencv2/core/utility.hpp" +#include "opencv2/core/private.hpp" #include "opencv2/opencv_modules.hpp" diff --git a/modules/superres/src/precomp.hpp b/modules/superres/src/precomp.hpp index 870bde9..0959b3b 100644 --- a/modules/superres/src/precomp.hpp +++ b/modules/superres/src/precomp.hpp @@ -53,6 +53,7 @@ #include "opencv2/core/utility.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/video/tracking.hpp" +#include "opencv2/core/private.hpp" #ifdef HAVE_OPENCV_GPU #include "opencv2/gpu.hpp" -- 2.7.4