opencv: Update to 3.3.0
This commit is contained in:
11
mingw-w64-opencv/0009-openblas-find.patch
Normal file
11
mingw-w64-opencv/0009-openblas-find.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
diff -Naur a/cmake/OpenCVFindOpenBLAS.cmake b/cmake/OpenCVFindOpenBLAS.cmake
|
||||
--- a/cmake/OpenCVFindOpenBLAS.cmake 2017-03-08 20:21:41.669934400 -0500
|
||||
+++ b/cmake/OpenCVFindOpenBLAS.cmake 2017-03-08 20:23:59.354590300 -0500
|
||||
@@ -53,6 +53,7 @@
|
||||
/opt/OpenBLAS/include
|
||||
$ENV{OpenBLAS_HOME}
|
||||
$ENV{OpenBLAS_HOME}/include
|
||||
+ $ENV{OpenBLAS_HOME}/include/OpenBLAS
|
||||
)
|
||||
|
||||
SET(Open_BLAS_LIB_SEARCH_PATHS
|
||||
25
mingw-w64-opencv/0010-find-libpng-header.patch
Normal file
25
mingw-w64-opencv/0010-find-libpng-header.patch
Normal file
@@ -0,0 +1,25 @@
|
||||
--- opencv-3.3.0/modules/imgcodecs/src/grfmt_png.cpp.orig 2017-09-16 22:17:59.122629700 +0300
|
||||
+++ opencv-3.3.0/modules/imgcodecs/src/grfmt_png.cpp 2017-09-16 22:24:12.164966500 +0300
|
||||
@@ -59,7 +59,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBPNG_PNG_H
|
||||
-#include <libpng/png.h>
|
||||
+#include <libpng16/png.h>
|
||||
#else
|
||||
#include <png.h>
|
||||
#endif
|
||||
--- opencv-3.3.0/cmake/OpenCVFindLibsGrfmt.cmake.orig 2017-09-16 22:17:59.122629700 +0300
|
||||
+++ opencv-3.3.0/cmake/OpenCVFindLibsGrfmt.cmake 2017-09-16 22:24:12.164966500 +0300
|
||||
@@ -163,9 +163,9 @@
|
||||
include(FindPNG)
|
||||
if(PNG_FOUND)
|
||||
include(CheckIncludeFile)
|
||||
- check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" HAVE_LIBPNG_PNG_H)
|
||||
+ check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng16/png.h" HAVE_LIBPNG_PNG_H)
|
||||
if(HAVE_LIBPNG_PNG_H)
|
||||
- ocv_parse_header("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE)
|
||||
+ ocv_parse_header("${PNG_PNG_INCLUDE_DIR}/libpng16/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE)
|
||||
else()
|
||||
ocv_parse_header("${PNG_PNG_INCLUDE_DIR}/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE)
|
||||
endif()
|
||||
12
mingw-w64-opencv/0011-dshow-build-fix.patch
Normal file
12
mingw-w64-opencv/0011-dshow-build-fix.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
--- opencv-3.3.0/modules/videoio/src/cap_dshow.cpp.orig 2017-09-16 22:17:59.122629700 +0300
|
||||
+++ opencv-3.3.0/modules/videoio/src/cap_dshow.cpp 2017-09-16 22:24:12.164966500 +0300
|
||||
@@ -108,6 +108,9 @@
|
||||
#include <vector>
|
||||
|
||||
//Include Directshow stuff here so we don't worry about needing all the h files.
|
||||
+#ifdef __MINGW32__
|
||||
+#define STRSAFE_NO_DEPRECATE
|
||||
+#endif
|
||||
#include "DShow.h"
|
||||
#include "strmif.h"
|
||||
#include "Aviriff.h"
|
||||
35
mingw-w64-opencv/0012-dnn_modern-test-fix.patch
Normal file
35
mingw-w64-opencv/0012-dnn_modern-test-fix.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
--- opencv_contrib-3.3.0/modules/dnn_modern/samples/simple_test.cpp.orig 2017-09-17 11:57:35.710737500 +0300
|
||||
+++ opencv_contrib-3.3.0/modules/dnn_modern/samples/simple_test.cpp 2017-09-17 12:00:12.997733800 +0300
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
vector<string> get_label_list(const string& label_file);
|
||||
void print_n_labels(const vector<string>& labels,
|
||||
- const vector<float_t>& result,
|
||||
+ const vector<float>& result,
|
||||
const int top_n);
|
||||
|
||||
vector<string> get_label_list(const string& label_file) {
|
||||
@@ -46,11 +46,11 @@
|
||||
}
|
||||
|
||||
void print_n_labels(const vector<string>& labels,
|
||||
- const vector<float_t>& result,
|
||||
+ const vector<float>& result,
|
||||
const int top_n) {
|
||||
- vector<float_t> sorted(result.begin(), result.end());
|
||||
+ vector<float> sorted(result.begin(), result.end());
|
||||
|
||||
- partial_sort(sorted.begin(), sorted.begin()+top_n, sorted.end(), greater<float_t>());
|
||||
+ partial_sort(sorted.begin(), sorted.begin()+top_n, sorted.end(), greater<float>());
|
||||
|
||||
for (int i = 0; i < top_n; i++) {
|
||||
size_t idx = distance(result.begin(), find(result.begin(), result.end(), sorted[i]));
|
||||
@@ -80,7 +80,7 @@
|
||||
cv::Mat img = cv::imread(img_file, -1);
|
||||
|
||||
// inference !
|
||||
- vector<float_t> scores;
|
||||
+ vector<float> scores;
|
||||
caffe_ptr->eval(img, scores);
|
||||
|
||||
// retrieve n labels
|
||||
@@ -3,8 +3,8 @@
|
||||
_realname=opencv
|
||||
pkgbase=mingw-w64-${_realname}
|
||||
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
|
||||
pkgver=3.2.0
|
||||
pkgrel=7
|
||||
pkgver=3.3.0
|
||||
pkgrel=1
|
||||
pkgdesc="Open Source Computer Vision Library (mingw-w64)"
|
||||
arch=('any')
|
||||
url="http://opencv.org/"
|
||||
@@ -16,9 +16,9 @@ depends=(#"${MINGW_PACKAGE_PREFIX}-gst-plugins-base
|
||||
"${MINGW_PACKAGE_PREFIX}-libpng"
|
||||
"${MINGW_PACKAGE_PREFIX}-libtiff"
|
||||
"${MINGW_PACKAGE_PREFIX}-libwebp"
|
||||
"${MINGW_PACKAGE_PREFIX}-openblas"
|
||||
"${MINGW_PACKAGE_PREFIX}-openexr"
|
||||
"${MINGW_PACKAGE_PREFIX}-zlib"
|
||||
"${MINGW_PACKAGE_PREFIX}-libwebp"
|
||||
#"${MINGW_PACKAGE_PREFIX}-qt5"
|
||||
#"${MINGW_PACKAGE_PREFIX}-gtkglext"
|
||||
#"${MINGW_PACKAGE_PREFIX}-gtk2"
|
||||
@@ -30,6 +30,7 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
|
||||
"${MINGW_PACKAGE_PREFIX}-python2-numpy"
|
||||
"${MINGW_PACKAGE_PREFIX}-python3-numpy"
|
||||
"${MINGW_PACKAGE_PREFIX}-tesseract-ocr"
|
||||
"${MINGW_PACKAGE_PREFIX}-tiny-dnn"
|
||||
"${MINGW_PACKAGE_PREFIX}-hdf5"
|
||||
"${MINGW_PACKAGE_PREFIX}-vtk")
|
||||
optdepends=("${MINGW_PACKAGE_PREFIX}-eigen3"
|
||||
@@ -45,12 +46,16 @@ source=("${_realname}-${pkgver}.tar.gz"::https://github.com/opencv/opencv/archiv
|
||||
'0002-solve_deg3-underflow.patch'
|
||||
'0003-issue-4107.patch'
|
||||
'0004-generate-proper-pkg-config-file.patch'
|
||||
'0005-opencv-support-python-3.5.patch'
|
||||
'0005-opencv-support-python-3.6.patch'
|
||||
'0006-somehow-uint-not-detected.patch'
|
||||
'0007-mingw-w64-have-sincos.patch'
|
||||
'0008-mingw-w64-cmake-lib-path.patch')
|
||||
sha256sums=('b9d62dfffb8130d59d587627703d5f3e6252dce4a94c1955784998da7a39dd35'
|
||||
'1e2bb6c9a41c602904cc7df3f8fb8f98363a88ea564f2a087240483426bf8cbe'
|
||||
'0008-mingw-w64-cmake-lib-path.patch'
|
||||
'0009-openblas-find.patch'
|
||||
'0010-find-libpng-header.patch'
|
||||
'0011-dshow-build-fix.patch'
|
||||
'0012-dnn_modern-test-fix.patch')
|
||||
sha256sums=('95029eb5578af3b20b8c7f8f6f59db1b827c2d5aaaa74b6becb1de647cbdda5a'
|
||||
'e94acf39cd4854c3ef905e06516e5f74f26dddfa6477af89558fb40a57aeb444'
|
||||
'9ce9cd5cbf76aea9f007f388dd71ccd7c9a656a274a84ef9a4e45af77b211fc0'
|
||||
'fd4e095c3c879413184fc6b91a7b0a77dbb128612341a8be2c99d804a203e362'
|
||||
'52ebc8875b9ef3ea70897f34509228daeff73d0cab0aa9eb8b931be6a7d32d7f'
|
||||
@@ -58,7 +63,11 @@ sha256sums=('b9d62dfffb8130d59d587627703d5f3e6252dce4a94c1955784998da7a39dd35'
|
||||
'837e637d1040b6bc3427d650e26cf1abb0178b322f2fbb43ccb2d5506f7b1c58'
|
||||
'7d2ff25f97c84b59793502786dd64e25c8ca991b0523ffea56b45ce031e80c3f'
|
||||
'ba227bb88c7e6948c54c5a3c8347daf5e2c930e99fb155047015bc5cfa2b33e5'
|
||||
'434b3bb1f6fd3af31952de5c4af95eb726f4e45b077e98195f8c204732bc9754')
|
||||
'434b3bb1f6fd3af31952de5c4af95eb726f4e45b077e98195f8c204732bc9754'
|
||||
'af2ff48a93e8a789b581163e62f67ff8bddfe741372d1c98fc21c77057f2743e'
|
||||
'15d4cf15196c7557af6e14d1d7b99aa9b462bd13435b3878dc28f85d00aa3e72'
|
||||
'7958ac5d80c643060e482fd6bac3bddd1199c1629ea6bea674179e7279b07d5d'
|
||||
'44dc368dcf0c882a81fe4a38b4269e7139686cb108890d890c14db3b0ec4c002')
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/${_realname}-${pkgver}"
|
||||
@@ -67,40 +76,25 @@ prepare() {
|
||||
patch -Np1 -i "${srcdir}/0002-solve_deg3-underflow.patch"
|
||||
patch -Np1 -i "${srcdir}/0003-issue-4107.patch"
|
||||
patch -Np1 -i "${srcdir}/0004-generate-proper-pkg-config-file.patch"
|
||||
patch -Np1 -i "${srcdir}/0005-opencv-support-python-3.5.patch"
|
||||
patch -Np1 -i "${srcdir}/0005-opencv-support-python-3.6.patch"
|
||||
|
||||
patch -Np1 -i "${srcdir}/0008-mingw-w64-cmake-lib-path.patch"
|
||||
patch -Np1 -i "${srcdir}/0009-openblas-find.patch"
|
||||
patch -Np1 -i "${srcdir}/0010-find-libpng-header.patch"
|
||||
patch -Np1 -i "${srcdir}/0011-dshow-build-fix.patch"
|
||||
|
||||
cd "${srcdir}/${_realname}_contrib-${pkgver}"
|
||||
patch -Np1 -i "${srcdir}/0006-somehow-uint-not-detected.patch"
|
||||
patch -Np1 -i "${srcdir}/0007-mingw-w64-have-sincos.patch"
|
||||
patch -Np1 -i "${srcdir}/0012-dnn_modern-test-fix.patch"
|
||||
}
|
||||
|
||||
build() {
|
||||
[[ "${CARCH}" = "i686" ]] && {
|
||||
# SSE only available from Pentium 3 onwards (i686 is way older)
|
||||
_cmakeopts=('-DENABLE_SSE=OFF'
|
||||
'-DENABLE_SSE2=OFF'
|
||||
'-DENABLE_SSE3=OFF')
|
||||
CXXFLAGS+=" -DEIGEN_DONT_VECTORIZE"
|
||||
_ffmpeg_plugin='opencv_ffmpeg.dll'
|
||||
}
|
||||
|
||||
[[ "${CARCH}" = "x86_64" ]] && {
|
||||
# all x64 CPUs support SSE2 but not SSE3
|
||||
_cmakeopts+=('-DENABLE_SSE3=OFF')
|
||||
_ffmpeg_plugin='opencv_ffmpeg_64.dll'
|
||||
}
|
||||
|
||||
# pushd ${srcdir}/${_realname}-${pkgver}/3rdparty/ffmpeg > /dev/null
|
||||
# rm -f ./*.dll
|
||||
# gcc -Wall -shared -o ${_ffmpeg_plugin} ${CXXFLAGS} -x c++ \
|
||||
# -I../include -I../../modules/highgui/src -I../../modules/videoio/src ffopencv.c \
|
||||
# -lavformat -lavcodec -lavdevice -lswscale -lavutil -lws2_32
|
||||
# popd > /dev/null
|
||||
|
||||
[[ -d ${srcdir}/build-${CARCH} ]] && rm -rf ${srcdir}/build-${CARCH}
|
||||
mkdir -p ${srcdir}/build-${CARCH} && cd ${srcdir}/build-${CARCH}
|
||||
|
||||
export OpenBLAS_HOME=${MINGW_PREFIX}
|
||||
export TINYDNN_ROOT=${MINGW_PREFIX}/include/tiny_dnn
|
||||
|
||||
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
|
||||
${MINGW_PREFIX}/bin/cmake.exe -Wno-dev \
|
||||
@@ -129,7 +123,6 @@ build() {
|
||||
-DENABLE_PRECOMPILED_HEADERS=OFF \
|
||||
-DOPENCV_EXTRA_MODULES_PATH=../${_realname}_contrib-${pkgver}/modules \
|
||||
-DBUILD_opencv_bioinspired=OFF \
|
||||
${_cmakeopts[@]} \
|
||||
../${_realname}-${pkgver}
|
||||
|
||||
make
|
||||
|
||||
Reference in New Issue
Block a user