From 5f17cc1abdd71fe7c7b9e874cee6e6bceb7ebc85 Mon Sep 17 00:00:00 2001 From: Hamdi Sahloul Date: Fri, 28 Sep 2018 08:58:30 +0900 Subject: [PATCH] Fix Python wrapper for GpuMat --- .../python/{pyopencv_core.hpp => pyopencv_cuda.hpp} | 13 +++++++++++++ 1 file changed, 13 insertions(+) rename modules/core/misc/python/{pyopencv_core.hpp => pyopencv_cuda.hpp} (64%) diff --git a/modules/core/misc/python/pyopencv_core.hpp b/modules/core/misc/python/pyopencv_cuda.hpp similarity index 64% rename from modules/core/misc/python/pyopencv_core.hpp rename to modules/core/misc/python/pyopencv_cuda.hpp index 8f7abb08da..62d2397b90 100644 --- a/modules/core/misc/python/pyopencv_core.hpp +++ b/modules/core/misc/python/pyopencv_cuda.hpp @@ -7,6 +7,19 @@ typedef cuda::GpuMat::Allocator GpuMat_Allocator; typedef cuda::HostMem::AllocType HostMem_AllocType; typedef cuda::Event::CreateFlags Event_CreateFlags; +template<> struct pyopencvVecConverter +{ + static bool to(PyObject* obj, std::vector& value, const ArgInfo info) + { + return pyopencv_to_generic_vec(obj, value, info); + } + + static PyObject* from(const std::vector& value) + { + return pyopencv_from_generic_vec(value); + } +}; + CV_PY_TO_CLASS(cuda::GpuMat); CV_PY_TO_CLASS(cuda::Stream); CV_PY_TO_CLASS(cuda::Event);