From: Andrey Kamaev Date: Thu, 21 Feb 2013 20:14:58 +0000 (+0400) Subject: Fix binary compatibility of gpu module X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1314^2~1489^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=995154d10d0fb6260f515f063029790a5f18191e;p=platform%2Fupstream%2Fopencv.git Fix binary compatibility of gpu module --- diff --git a/modules/gpu/include/opencv2/gpu/gpu.hpp b/modules/gpu/include/opencv2/gpu/gpu.hpp index afbe067..a9481b2 100644 --- a/modules/gpu/include/opencv2/gpu/gpu.hpp +++ b/modules/gpu/include/opencv2/gpu/gpu.hpp @@ -815,6 +815,10 @@ struct CV_EXPORTS CannyBuf GpuMat st1, st2; GpuMat unused; Ptr filterDX, filterDY; + + CannyBuf() {} + explicit CannyBuf(const Size& image_size, int apperture_size = 3) {create(image_size, apperture_size);} + CannyBuf(const GpuMat& dx_, const GpuMat& dy_); }; CV_EXPORTS void Canny(const GpuMat& image, GpuMat& edges, double low_thresh, double high_thresh, int apperture_size = 3, bool L2gradient = false); @@ -1879,11 +1883,9 @@ private: vector prevPyr_; vector nextPyr_; GpuMat vPyr_[2]; - vector unused1; - vector unused2; - bool unused3; - - GpuMat buf_; + vector buf_; + vector unused; + bool isDeviceArch11_; }; diff --git a/modules/gpu/src/imgproc.cpp b/modules/gpu/src/imgproc.cpp index 24f015b..3184717 100644 --- a/modules/gpu/src/imgproc.cpp +++ b/modules/gpu/src/imgproc.cpp @@ -45,6 +45,9 @@ using namespace cv; using namespace cv::gpu; +/*stub for deprecated constructor*/ +cv::gpu::CannyBuf::CannyBuf(const GpuMat&, const GpuMat&) { } + #if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::meanShiftFiltering(const GpuMat&, GpuMat&, int, int, TermCriteria, Stream&) { throw_nogpu(); } diff --git a/modules/gpu/src/pyrlk.cpp b/modules/gpu/src/pyrlk.cpp index 49a6c5a..148bcb5 100644 --- a/modules/gpu/src/pyrlk.cpp +++ b/modules/gpu/src/pyrlk.cpp @@ -147,11 +147,13 @@ void cv::gpu::PyrLKOpticalFlow::sparse(const GpuMat& prevImg, const GpuMat& next } else { - cvtColor(prevImg, buf_, COLOR_BGR2BGRA); - buf_.convertTo(prevPyr_[0], CV_32F); + buf_.resize(1); - cvtColor(nextImg, buf_, COLOR_BGR2BGRA); - buf_.convertTo(nextPyr_[0], CV_32F); + cvtColor(prevImg, buf_[0], COLOR_BGR2BGRA); + buf_[0].convertTo(prevPyr_[0], CV_32F); + + cvtColor(nextImg, buf_[0], COLOR_BGR2BGRA); + buf_[0].convertTo(nextPyr_[0], CV_32F); } for (int level = 1; level <= maxLevel; ++level) @@ -237,7 +239,7 @@ void cv::gpu::PyrLKOpticalFlow::releaseMemory() prevPyr_.clear(); nextPyr_.clear(); - buf_.release(); + buf_.clear(); uPyr_[0].release(); vPyr_[0].release();