From 8869dc776287a1b43b252a91ceb36cc26a56eed4 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sun, 20 Dec 2020 22:15:49 +0000 Subject: [PATCH 1/5] release: OpenCV 3.4.13 --- modules/core/include/opencv2/core/version.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/include/opencv2/core/version.hpp b/modules/core/include/opencv2/core/version.hpp index 16e0fb2a4c..7b5bb2de28 100644 --- a/modules/core/include/opencv2/core/version.hpp +++ b/modules/core/include/opencv2/core/version.hpp @@ -8,7 +8,7 @@ #define CV_VERSION_MAJOR 3 #define CV_VERSION_MINOR 4 #define CV_VERSION_REVISION 13 -#define CV_VERSION_STATUS "-pre" +#define CV_VERSION_STATUS "" #define CVAUX_STR_EXP(__A) #__A #define CVAUX_STR(__A) CVAUX_STR_EXP(__A) From 0681deb3c9fab8c53977818d60261533c3968a54 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 23 Dec 2020 15:07:12 +0000 Subject: [PATCH 2/5] js: fix Python 3 support in make_umd.py --- modules/js/src/make_umd.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/js/src/make_umd.py b/modules/js/src/make_umd.py index 08d9e39e13..bed6ee9bcc 100644 --- a/modules/js/src/make_umd.py +++ b/modules/js/src/make_umd.py @@ -69,13 +69,16 @@ import os, sys, re, json, shutil from subprocess import Popen, PIPE, STDOUT +PY3 = sys.version_info >= (3, 0) + def make_umd(opencvjs, cvjs): - src = open(opencvjs, 'r+b') - dst = open(cvjs, 'w+b') - content = src.read() - dst.seek(0) - # inspired by https://github.com/umdjs/umd/blob/95563fd6b46f06bda0af143ff67292e7f6ede6b7/templates/returnExportsGlobal.js - dst.write((""" + with open(opencvjs, 'r+b') as src: + content = src.read() + if PY3: # content is bytes + content = content.decode('utf-8') + with open(cvjs, 'w+b') as dst: + # inspired by https://github.com/umdjs/umd/blob/95563fd6b46f06bda0af143ff67292e7f6ede6b7/templates/returnExportsGlobal.js + dst.write((""" (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -103,7 +106,8 @@ def make_umd(opencvjs, cvjs): Module = {}; return cv(Module); })); - """ % (content)).lstrip().encode()) + """ % (content)).lstrip().encode('utf-8')) + if __name__ == "__main__": if len(sys.argv) > 2: From 7eeba4d485b7990aeb17c059b791b5cbc2ebfc7b Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Thu, 24 Dec 2020 05:23:42 +0000 Subject: [PATCH 3/5] js(build): reuse Python executable used to run main script - don't switch between Python versions in the middle of the build --- platforms/js/build_js.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platforms/js/build_js.py b/platforms/js/build_js.py index afe37c6949..37ff956de2 100644 --- a/platforms/js/build_js.py +++ b/platforms/js/build_js.py @@ -77,7 +77,9 @@ class Builder: rm_one(d) def get_cmake_cmd(self): - cmd = ["cmake", + cmd = [ + "cmake", + "-DPYTHON_DEFAULT_EXECUTABLE=%s" % sys.executable, "-DENABLE_PIC=FALSE", # To workaround emscripten upstream backend issue https://github.com/emscripten-core/emscripten/issues/8761 "-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_TOOLCHAIN_FILE='%s'" % self.get_toolchain_file(), From 064d48771de57a06c46bc66997603fbbd3a01eb6 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 23 Dec 2020 09:51:23 +0300 Subject: [PATCH 4/5] Find only shared IE libraries, not plugins original commit: 3ed376d10377eece4c2dba6e0bdee53451da14ed --- cmake/OpenCVDetectInferenceEngine.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/OpenCVDetectInferenceEngine.cmake b/cmake/OpenCVDetectInferenceEngine.cmake index 9af1051fa0..34f3df17dc 100644 --- a/cmake/OpenCVDetectInferenceEngine.cmake +++ b/cmake/OpenCVDetectInferenceEngine.cmake @@ -68,7 +68,13 @@ function(add_custom_ie_build _inc _lib _lib_rel _lib_dbg _msg) if(find_prefix STREQUAL "_empty_") # foreach doesn't iterate over empty elements set(find_prefix "") endif() - foreach(find_suffix ${CMAKE_FIND_LIBRARY_SUFFIXES}) + if(NOT DEFINED INFERENCE_ENGINE_FIND_LIBRARY_SUFFIXES) # allow custom override + set(INFERENCE_ENGINE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + if(APPLE) + ocv_list_filterout(INFERENCE_ENGINE_FIND_LIBRARY_SUFFIXES "^.so$") # skip plugins (can't be linked) + endif() + endif() + foreach(find_suffix ${INFERENCE_ENGINE_FIND_LIBRARY_SUFFIXES}) ocv_ie_find_extra_libraries("${find_prefix}" "${find_suffix}") endforeach() if(NOT CMAKE_FIND_LIBRARY_SUFFIXES) From 6e1da2ef91907678159d40f600a56094c4d196b9 Mon Sep 17 00:00:00 2001 From: Zhuo Zhang Date: Fri, 25 Dec 2020 00:58:16 +0800 Subject: [PATCH 5/5] Merge pull request #19203 from zchrissirhcz:fix-cvSaveImage Fix cvSaveImage( ) function bug * fix cvSaveImage crash * replace emplace_back with {}, no C++11 required * fix MacOSX build with vector's push_back --- modules/imgcodecs/src/loadsave.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/imgcodecs/src/loadsave.cpp b/modules/imgcodecs/src/loadsave.cpp index 4e626cd216..44c458c727 100644 --- a/modules/imgcodecs/src/loadsave.cpp +++ b/modules/imgcodecs/src/loadsave.cpp @@ -1065,7 +1065,9 @@ cvSaveImage( const char* filename, const CvArr* arr, const int* _params ) for( ; _params[i] > 0; i += 2 ) CV_Assert(static_cast(i) < cv::CV_IO_MAX_IMAGE_PARAMS*2); // Limit number of params for security reasons } - return cv::imwrite_(filename, cv::cvarrToMat(arr), + std::vector img_vec; + img_vec.push_back(cv::cvarrToMat(arr)); + return cv::imwrite_(filename, img_vec, i > 0 ? std::vector(_params, _params+i) : std::vector(), CV_IS_IMAGE(arr) && ((const IplImage*)arr)->origin == IPL_ORIGIN_BL ); }