From 6bcf0b5519c190826cf0f21efd87cbe256eabc48 Mon Sep 17 00:00:00 2001 From: Dmitry Kurtaev Date: Wed, 19 Dec 2018 23:37:55 +0300 Subject: [PATCH] Merge pull request #13482 from dkurt:fix_python_bindings_without_stitching * Fix python bindings without stitching module * stitching: move stitching specific code into modules/stitching/misc --- .../misc/python/pyopencv_rotationwarper.hpp | 8 ---- modules/python/src2/cv2.cpp | 41 ------------------ .../misc/python/pyopencv_stitching.hpp | 43 +++++++++++++++++++ 3 files changed, 43 insertions(+), 49 deletions(-) delete mode 100644 modules/core/misc/python/pyopencv_rotationwarper.hpp diff --git a/modules/core/misc/python/pyopencv_rotationwarper.hpp b/modules/core/misc/python/pyopencv_rotationwarper.hpp deleted file mode 100644 index 0fac1854fb..0000000000 --- a/modules/core/misc/python/pyopencv_rotationwarper.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef HAVE_OPENCV_STITCHING - -typedef std::vector vector_ImageFeatures; -typedef std::vector vector_MatchesInfo; -typedef std::vector vector_CameraParams; - - -#endif diff --git a/modules/python/src2/cv2.cpp b/modules/python/src2/cv2.cpp index d46b50327b..df1608be27 100644 --- a/modules/python/src2/cv2.cpp +++ b/modules/python/src2/cv2.cpp @@ -1378,47 +1378,6 @@ template<> struct pyopencvVecConverter } }; -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); - } -}; - -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); - } -}; - -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); - } -}; - - - template<> struct pyopencvVecConverter { static bool to(PyObject* obj, std::vector& value, const ArgInfo info) diff --git a/modules/stitching/misc/python/pyopencv_stitching.hpp b/modules/stitching/misc/python/pyopencv_stitching.hpp index 634e8dd1d5..13ebfc9c95 100644 --- a/modules/stitching/misc/python/pyopencv_stitching.hpp +++ b/modules/stitching/misc/python/pyopencv_stitching.hpp @@ -3,4 +3,47 @@ typedef Stitcher::Status Status; typedef Stitcher::Mode Mode; +typedef std::vector vector_ImageFeatures; +typedef std::vector vector_MatchesInfo; +typedef std::vector vector_CameraParams; + +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); + } +}; + +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); + } +}; + +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); + } +}; + #endif