From 9df6e51a5bff302230ad0291302d12f7cdc92eeb Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Sat, 12 May 2012 09:45:21 +0000 Subject: [PATCH] added gpu::compare with scalars (Feature #1754) --- modules/gpu/include/opencv2/gpu/gpu.hpp | 3 +- modules/gpu/src/cuda/element_operations.cu | 325 +++++++++++++++------ modules/gpu/src/element_operations.cpp | 69 ++++- modules/gpu/test/test_core.cpp | 111 ++++++- 4 files changed, 410 insertions(+), 98 deletions(-) diff --git a/modules/gpu/include/opencv2/gpu/gpu.hpp b/modules/gpu/include/opencv2/gpu/gpu.hpp index 3b4ffca6a4..b41002f4e0 100644 --- a/modules/gpu/include/opencv2/gpu/gpu.hpp +++ b/modules/gpu/include/opencv2/gpu/gpu.hpp @@ -527,6 +527,7 @@ CV_EXPORTS void pow(const GpuMat& src, double power, GpuMat& dst, Stream& stream //! compares elements of two arrays (c = a b) CV_EXPORTS void compare(const GpuMat& a, const GpuMat& b, GpuMat& c, int cmpop, Stream& stream = Stream::Null()); +CV_EXPORTS void compare(const GpuMat& a, Scalar sc, GpuMat& dst, int cmpop, Stream& stream = Stream::Null()); //! performs per-elements bit-wise inversion CV_EXPORTS void bitwise_not(const GpuMat& src, GpuMat& dst, const GpuMat& mask=GpuMat(), Stream& stream = Stream::Null()); @@ -1371,7 +1372,7 @@ private: std::vector trainDescCollection; }; -template +template class CV_EXPORTS BruteForceMatcher_GPU; template diff --git a/modules/gpu/src/cuda/element_operations.cu b/modules/gpu/src/cuda/element_operations.cu index fab6176704..6488b64b62 100644 --- a/modules/gpu/src/cuda/element_operations.cu +++ b/modules/gpu/src/cuda/element_operations.cu @@ -1158,130 +1158,279 @@ namespace cv { namespace gpu { namespace device ////////////////////////////////////////////////////////////////////////////////////// // Compare - template struct Equal : binary_function +#define TYPE_VEC(type, cn) typename TypeVec::vec_type + + template