Commit bf6c08a9 authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

fixed compilation with CUDA

parent 6ef43cd9
...@@ -224,7 +224,7 @@ void cv::gpu::CudaMem::create(int _rows, int _cols, int _type, int _alloc_type) ...@@ -224,7 +224,7 @@ void cv::gpu::CudaMem::create(int _rows, int _cols, int _type, int _alloc_type)
if (_alloc_type == ALLOC_ZEROCOPY && !canMapHostMemory()) if (_alloc_type == ALLOC_ZEROCOPY && !canMapHostMemory())
cv::gpu::error("ZeroCopy is not supported by current device", __FILE__, __LINE__); 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 ) if( rows == _rows && cols == _cols && type() == _type && data )
return; return;
if( data ) if( data )
......
...@@ -125,8 +125,8 @@ GPU_TEST_P(FGDStatModel, Update) ...@@ -125,8 +125,8 @@ GPU_TEST_P(FGDStatModel, Update)
ASSERT_EQ(gold_count, count); ASSERT_EQ(gold_count, count);
cv::Mat gold_background(model->background); cv::Mat gold_background = cv::cvarrToMat(model->background);
cv::Mat gold_foreground(model->foreground); cv::Mat gold_foreground = cv::cvarrToMat(model->foreground);
if (out_cn == 3) if (out_cn == 3)
d_model.background.download(h_background3); d_model.background.download(h_background3);
......
...@@ -64,6 +64,8 @@ ...@@ -64,6 +64,8 @@
#include <iterator> #include <iterator>
#include <stdexcept> #include <stdexcept>
#include "opencv2/core/private.hpp"
#ifdef HAVE_CUDA #ifdef HAVE_CUDA
#include <cuda.h> #include <cuda.h>
#include <cuda_runtime.h> #include <cuda_runtime.h>
......
...@@ -1096,10 +1096,7 @@ cvShowImage( const char* name, const CvArr* arr ) ...@@ -1096,10 +1096,7 @@ cvShowImage( const char* name, const CvArr* arr )
#ifdef HAVE_OPENGL #ifdef HAVE_OPENGL
if (window->useGl) if (window->useGl)
{ {
CvMat stub; cv::imshow(name, cv::cvarrToMat(arr));
CvMat* mat = cvGetMat(arr, &stub);
cv::Mat im(mat);
cv::imshow(name, im);
return; return;
} }
#endif #endif
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "opencv2/imgproc.hpp" #include "opencv2/imgproc.hpp"
#include "opencv2/core/utility.hpp" #include "opencv2/core/utility.hpp"
#include "opencv2/core/private.hpp"
#include "opencv2/opencv_modules.hpp" #include "opencv2/opencv_modules.hpp"
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include "opencv2/core/utility.hpp" #include "opencv2/core/utility.hpp"
#include "opencv2/imgproc.hpp" #include "opencv2/imgproc.hpp"
#include "opencv2/video/tracking.hpp" #include "opencv2/video/tracking.hpp"
#include "opencv2/core/private.hpp"
#ifdef HAVE_OPENCV_GPU #ifdef HAVE_OPENCV_GPU
#include "opencv2/gpu.hpp" #include "opencv2/gpu.hpp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment