From e13a73d084c27bb8d44d4eb17d86ea84fe80b95b Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Fri, 7 Feb 2020 15:59:34 +0100 Subject: [PATCH] core: export getCPUFeaturesLine to bindings --- modules/core/include/opencv2/core/utility.hpp | 2 +- modules/python/src2/cv2.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/core/include/opencv2/core/utility.hpp b/modules/core/include/opencv2/core/utility.hpp index 063747e730..86cd2f1fe0 100644 --- a/modules/core/include/opencv2/core/utility.hpp +++ b/modules/core/include/opencv2/core/utility.hpp @@ -447,7 +447,7 @@ Returned value is a string containing space separated list of CPU features with Example: `SSE SSE2 SSE3 *SSE4.1 *SSE4.2 *FP16 *AVX *AVX2 *AVX512-SKX?` */ -CV_EXPORTS std::string getCPUFeaturesLine(); +CV_EXPORTS_W std::string getCPUFeaturesLine(); /** @brief Returns the number of logical CPUs available for the process. */ diff --git a/modules/python/src2/cv2.cpp b/modules/python/src2/cv2.cpp index 0b516a4e9d..39d7c55823 100644 --- a/modules/python/src2/cv2.cpp +++ b/modules/python/src2/cv2.cpp @@ -952,6 +952,14 @@ PyObject* pyopencv_from(const String& value) return PyString_FromString(value.empty() ? "" : value.c_str()); } +#if CV_VERSION_MAJOR == 3 +template<> +PyObject* pyopencv_from(const std::string& value) +{ + return PyString_FromString(value.empty() ? "" : value.c_str()); +} +#endif + template<> bool pyopencv_to(PyObject* obj, String &value, const ArgInfo& info) {