Update to 3.4.4

This commit is contained in:
Sérgio M. Basto 2018-12-02 19:14:48 +00:00
parent 1c43b0e0ab
commit e0285a0007
9 changed files with 163 additions and 254 deletions

2
.gitignore vendored
View File

@ -28,3 +28,5 @@ OpenCV-2.1.0.tar.bz2
/opencv-clean-3.4.2.tar.gz
/opencv_contrib-clean-3.4.3.tar.gz
/opencv-clean-3.4.3.tar.gz
/opencv-clean-3.4.4.tar.gz
/opencv_contrib-clean-3.4.4.tar.gz

View File

@ -1,211 +0,0 @@
From 4910f16f16a0a0c2b456b14cbc3429c86f96a5f5 Mon Sep 17 00:00:00 2001
From: Alexander Alekhin <alexander.alekhin@intel.com>
Date: Thu, 9 Aug 2018 19:49:34 +0300
Subject: [PATCH] core(libva): support YV12 too
Added to CPU path only.
OpenCL code path still expects NV12 only (according to Intel OpenCL extension)
---
modules/core/src/va_intel.cpp | 175 ++++++++++++++++++++++++++++++++--
1 file changed, 169 insertions(+), 6 deletions(-)
diff --git a/modules/core/src/va_intel.cpp b/modules/core/src/va_intel.cpp
index 0a2bfd96a36..a3baa4bf0bf 100644
--- a/modules/core/src/va_intel.cpp
+++ b/modules/core/src/va_intel.cpp
@@ -324,6 +324,163 @@ static void copy_convert_bgr_to_nv12(const VAImage& image, const Mat& bgr, unsig
dstUV += dstStepUV;
}
}
+
+
+static void copy_convert_yv12_to_bgr(const VAImage& image, const unsigned char* buffer, Mat& bgr)
+{
+ const float d1 = 16.0f;
+ const float d2 = 128.0f;
+
+ static const float coeffs[5] =
+ {
+ 1.163999557f,
+ 2.017999649f,
+ -0.390999794f,
+ -0.812999725f,
+ 1.5959997177f
+ };
+
+ CV_CheckEQ(image.format.fourcc, VA_FOURCC_YV12, "Unexpected image format");
+ CV_CheckEQ(image.num_planes, 3, "");
+
+ const size_t srcOffsetY = image.offsets[0];
+ const size_t srcOffsetV = image.offsets[1];
+ const size_t srcOffsetU = image.offsets[2];
+
+ const size_t srcStepY = image.pitches[0];
+ const size_t srcStepU = image.pitches[1];
+ const size_t srcStepV = image.pitches[2];
+
+ const size_t dstStep = bgr.step;
+
+ const unsigned char* srcY_ = buffer + srcOffsetY;
+ const unsigned char* srcV_ = buffer + srcOffsetV;
+ const unsigned char* srcU_ = buffer + srcOffsetU;
+
+ for (int y = 0; y < bgr.rows; y += 2)
+ {
+ const unsigned char* srcY0 = srcY_ + (srcStepY) * y;
+ const unsigned char* srcY1 = srcY0 + srcStepY;
+
+ const unsigned char* srcV = srcV_ + (srcStepV) * y / 2;
+ const unsigned char* srcU = srcU_ + (srcStepU) * y / 2;
+
+ unsigned char* dst0 = bgr.data + (dstStep) * y;
+ unsigned char* dst1 = dst0 + dstStep;
+
+ for (int x = 0; x < bgr.cols; x += 2)
+ {
+ float Y0 = float(srcY0[x+0]);
+ float Y1 = float(srcY0[x+1]);
+ float Y2 = float(srcY1[x+0]);
+ float Y3 = float(srcY1[x+1]);
+
+ float U = float(srcU[x/2]) - d2;
+ float V = float(srcV[x/2]) - d2;
+
+ Y0 = std::max(0.0f, Y0 - d1) * coeffs[0];
+ Y1 = std::max(0.0f, Y1 - d1) * coeffs[0];
+ Y2 = std::max(0.0f, Y2 - d1) * coeffs[0];
+ Y3 = std::max(0.0f, Y3 - d1) * coeffs[0];
+
+ float ruv = coeffs[4]*V;
+ float guv = coeffs[3]*V + coeffs[2]*U;
+ float buv = coeffs[1]*U;
+
+ dst0[(x+0)*NCHANNELS+0] = saturate_cast<unsigned char>(Y0 + buv);
+ dst0[(x+0)*NCHANNELS+1] = saturate_cast<unsigned char>(Y0 + guv);
+ dst0[(x+0)*NCHANNELS+2] = saturate_cast<unsigned char>(Y0 + ruv);
+
+ dst0[(x+1)*NCHANNELS+0] = saturate_cast<unsigned char>(Y1 + buv);
+ dst0[(x+1)*NCHANNELS+1] = saturate_cast<unsigned char>(Y1 + guv);
+ dst0[(x+1)*NCHANNELS+2] = saturate_cast<unsigned char>(Y1 + ruv);
+
+ dst1[(x+0)*NCHANNELS+0] = saturate_cast<unsigned char>(Y2 + buv);
+ dst1[(x+0)*NCHANNELS+1] = saturate_cast<unsigned char>(Y2 + guv);
+ dst1[(x+0)*NCHANNELS+2] = saturate_cast<unsigned char>(Y2 + ruv);
+
+ dst1[(x+1)*NCHANNELS+0] = saturate_cast<unsigned char>(Y3 + buv);
+ dst1[(x+1)*NCHANNELS+1] = saturate_cast<unsigned char>(Y3 + guv);
+ dst1[(x+1)*NCHANNELS+2] = saturate_cast<unsigned char>(Y3 + ruv);
+ }
+ }
+}
+
+static void copy_convert_bgr_to_yv12(const VAImage& image, const Mat& bgr, unsigned char* buffer)
+{
+ const float d1 = 16.0f;
+ const float d2 = 128.0f;
+
+ static const float coeffs[8] =
+ {
+ 0.256999969f, 0.50399971f, 0.09799957f, -0.1479988098f,
+ -0.2909994125f, 0.438999176f, -0.3679990768f, -0.0709991455f
+ };
+
+ CV_CheckEQ(image.format.fourcc, VA_FOURCC_YV12, "Unexpected image format");
+ CV_CheckEQ(image.num_planes, 3, "");
+
+ const size_t dstOffsetY = image.offsets[0];
+ const size_t dstOffsetV = image.offsets[1];
+ const size_t dstOffsetU = image.offsets[2];
+
+ const size_t dstStepY = image.pitches[0];
+ const size_t dstStepU = image.pitches[1];
+ const size_t dstStepV = image.pitches[2];
+
+ unsigned char* dstY_ = buffer + dstOffsetY;
+ unsigned char* dstV_ = buffer + dstOffsetV;
+ unsigned char* dstU_ = buffer + dstOffsetU;
+
+ const size_t srcStep = bgr.step;
+
+ for (int y = 0; y < bgr.rows; y += 2)
+ {
+ unsigned char* dstY0 = dstY_ + (dstStepY) * y;
+ unsigned char* dstY1 = dstY0 + dstStepY;
+
+ unsigned char* dstV = dstV_ + (dstStepV) * y / 2;
+ unsigned char* dstU = dstU_ + (dstStepU) * y / 2;
+
+ const unsigned char* src0 = bgr.data + (srcStep) * y;
+ const unsigned char* src1 = src0 + srcStep;
+
+ for (int x = 0; x < bgr.cols; x += 2)
+ {
+ float B0 = float(src0[(x+0)*NCHANNELS+0]);
+ float G0 = float(src0[(x+0)*NCHANNELS+1]);
+ float R0 = float(src0[(x+0)*NCHANNELS+2]);
+
+ float B1 = float(src0[(x+1)*NCHANNELS+0]);
+ float G1 = float(src0[(x+1)*NCHANNELS+1]);
+ float R1 = float(src0[(x+1)*NCHANNELS+2]);
+
+ float B2 = float(src1[(x+0)*NCHANNELS+0]);
+ float G2 = float(src1[(x+0)*NCHANNELS+1]);
+ float R2 = float(src1[(x+0)*NCHANNELS+2]);
+
+ float B3 = float(src1[(x+1)*NCHANNELS+0]);
+ float G3 = float(src1[(x+1)*NCHANNELS+1]);
+ float R3 = float(src1[(x+1)*NCHANNELS+2]);
+
+ float Y0 = coeffs[0]*R0 + coeffs[1]*G0 + coeffs[2]*B0 + d1;
+ float Y1 = coeffs[0]*R1 + coeffs[1]*G1 + coeffs[2]*B1 + d1;
+ float Y2 = coeffs[0]*R2 + coeffs[1]*G2 + coeffs[2]*B2 + d1;
+ float Y3 = coeffs[0]*R3 + coeffs[1]*G3 + coeffs[2]*B3 + d1;
+
+ float U = coeffs[3]*R0 + coeffs[4]*G0 + coeffs[5]*B0 + d2;
+ float V = coeffs[5]*R0 + coeffs[6]*G0 + coeffs[7]*B0 + d2;
+
+ dstY0[x+0] = saturate_cast<unsigned char>(Y0);
+ dstY0[x+1] = saturate_cast<unsigned char>(Y1);
+ dstY1[x+0] = saturate_cast<unsigned char>(Y2);
+ dstY1[x+1] = saturate_cast<unsigned char>(Y3);
+
+ dstU[x/2] = saturate_cast<unsigned char>(U);
+ dstV[x/2] = saturate_cast<unsigned char>(V);
+ }
+ }
+}
#endif // HAVE_VA
void convertToVASurface(VADisplay display, InputArray src, VASurfaceID surface, Size size)
@@ -412,9 +569,12 @@ void convertToVASurface(VADisplay display, InputArray src, VASurfaceID surface,
if (status != VA_STATUS_SUCCESS)
CV_Error(cv::Error::StsError, "VA-API: vaMapBuffer failed");
- CV_Assert(image.format.fourcc == VA_FOURCC_NV12);
-
- copy_convert_bgr_to_nv12(image, m, buffer);
+ if (image.format.fourcc == VA_FOURCC_NV12)
+ copy_convert_bgr_to_nv12(image, m, buffer);
+ if (image.format.fourcc == VA_FOURCC_YV12)
+ copy_convert_bgr_to_yv12(image, m, buffer);
+ else
+ CV_Check((int)image.format.fourcc, image.format.fourcc == VA_FOURCC_NV12 || image.format.fourcc == VA_FOURCC_YV12, "Unexpected image format");
status = vaUnmapBuffer(display, image.buf);
if (status != VA_STATUS_SUCCESS)
@@ -510,9 +670,12 @@ void convertFromVASurface(VADisplay display, VASurfaceID surface, Size size, Out
if (status != VA_STATUS_SUCCESS)
CV_Error(cv::Error::StsError, "VA-API: vaMapBuffer failed");
- CV_Assert(image.format.fourcc == VA_FOURCC_NV12);
-
- copy_convert_nv12_to_bgr(image, buffer, m);
+ if (image.format.fourcc == VA_FOURCC_NV12)
+ copy_convert_nv12_to_bgr(image, buffer, m);
+ if (image.format.fourcc == VA_FOURCC_YV12)
+ copy_convert_yv12_to_bgr(image, buffer, m);
+ else
+ CV_Check((int)image.format.fourcc, image.format.fourcc == VA_FOURCC_NV12 || image.format.fourcc == VA_FOURCC_YV12, "Unexpected image format");
status = vaUnmapBuffer(display, image.buf);
if (status != VA_STATUS_SUCCESS)

View File

@ -1,30 +0,0 @@
From 6a01e96ce795ed003cf83a777ba65d6dd2d8afce Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 9 Sep 2018 22:52:55 -0700
Subject: [PATCH] Add missing multi-line separator
Otherwise this fails to build ( found on mips )
Fixes
contrib/modules/surface_matching/src/hash_murmur86.hpp:97:15: error:
expected constructor, destructor, or type conversion before '(' token
&& defined(__GNUC__) && (__GNUC__>4 || (__GNUC__==4 &&
__GNUC_MINOR__>=3))
^
---
modules/surface_matching/src/hash_murmur86.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/surface_matching/src/hash_murmur86.hpp b/modules/surface_matching/src/hash_murmur86.hpp
index 1edf6bf421..0477d37edb 100644
--- a/modules/surface_matching/src/hash_murmur86.hpp
+++ b/modules/surface_matching/src/hash_murmur86.hpp
@@ -93,7 +93,7 @@ void hashMurmurx86 ( const void * key, const int len, const uint seed, void * ou
/* Now find best way we can to READ_UINT32 */
#ifndef WORDS_BIGENDIAN
# define READ_UINT32(ptr) (*((uint32_t*)(ptr)))
-#elif defined(WORDS_BIGENDIAN)
+#elif defined(WORDS_BIGENDIAN) \
&& defined(__GNUC__) && (__GNUC__>4 || (__GNUC__==4 && __GNUC_MINOR__>=3))
# define READ_UINT32(ptr) (__builtin_bswap32(*((uint32_t*)(ptr))))
#endif

View File

@ -0,0 +1,82 @@
From ad35b79e3f98b4ce30481e0299cca550ed77aef0 Mon Sep 17 00:00:00 2001
From: Alexander Alekhin <alexander.a.alekhin@gmail.com>
Date: Thu, 22 Nov 2018 21:06:33 +0000
Subject: [PATCH] python: update install paths
- don't require "OPENCV_PYTHON{2,3}_INSTALL_PATH" if OPENCV_SKIP_PYTHON_LOADER=ON
- avoid unnecessary relative paths in generated config-X.Y.py
---
CMakeLists.txt | 4 ++--
modules/python/common.cmake | 14 +++++++++-----
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fde8b578ba0..6298f4438c2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1494,7 +1494,7 @@ if(BUILD_opencv_python2)
status(" Libraries:" HAVE_opencv_python2 THEN "${PYTHON2_LIBRARIES}" ELSE NO)
endif()
status(" numpy:" PYTHON2_NUMPY_INCLUDE_DIRS THEN "${PYTHON2_NUMPY_INCLUDE_DIRS} (ver ${PYTHON2_NUMPY_VERSION})" ELSE "NO (Python wrappers can not be generated)")
- status(" packages path:" PYTHON2_EXECUTABLE THEN "${PYTHON2_PACKAGES_PATH}" ELSE "-")
+ status(" install path:" HAVE_opencv_python2 THEN "${__INSTALL_PATH_PYTHON2}" ELSE "-")
endif()
if(BUILD_opencv_python3)
@@ -1507,7 +1507,7 @@ if(BUILD_opencv_python3)
status(" Libraries:" HAVE_opencv_python3 THEN "${PYTHON3_LIBRARIES}" ELSE NO)
endif()
status(" numpy:" PYTHON3_NUMPY_INCLUDE_DIRS THEN "${PYTHON3_NUMPY_INCLUDE_DIRS} (ver ${PYTHON3_NUMPY_VERSION})" ELSE "NO (Python3 wrappers can not be generated)")
- status(" packages path:" PYTHON3_EXECUTABLE THEN "${PYTHON3_PACKAGES_PATH}" ELSE "-")
+ status(" install path:" HAVE_opencv_python3 THEN "${__INSTALL_PATH_PYTHON3}" ELSE "-")
endif()
status("")
diff --git a/modules/python/common.cmake b/modules/python/common.cmake
index 14912297eae..4b4eaa6e7f8 100644
--- a/modules/python/common.cmake
+++ b/modules/python/common.cmake
@@ -122,6 +122,8 @@ endif()
if(NOT " ${PYTHON}" STREQUAL " PYTHON" AND DEFINED OPENCV_${PYTHON}_INSTALL_PATH)
set(__python_binary_install_path "${OPENCV_${PYTHON}_INSTALL_PATH}")
+elseif(OPENCV_SKIP_PYTHON_LOADER AND DEFINED ${PYTHON}_PACKAGES_PATH)
+ set(__python_binary_install_path "${${PYTHON}_PACKAGES_PATH}")
else()
ocv_assert(DEFINED OPENCV_PYTHON_INSTALL_PATH)
set(__python_binary_install_path "${OPENCV_PYTHON_INSTALL_PATH}/${__python_loader_subdir}python-${${PYTHON}_VERSION_MAJOR}.${${PYTHON}_VERSION_MINOR}")
@@ -134,6 +136,8 @@ install(TARGETS ${the_module}
${PYTHON_INSTALL_ARCHIVE}
)
+set(__INSTALL_PATH_${PYTHON} "${__python_binary_install_path}" CACHE INTERNAL "") # CMake status
+
if(NOT OPENCV_SKIP_PYTHON_LOADER)
ocv_assert(DEFINED OPENCV_PYTHON_INSTALL_PATH)
if(OpenCV_FOUND)
@@ -143,12 +147,11 @@ if(NOT OPENCV_SKIP_PYTHON_LOADER)
endif()
set(__python_loader_install_tmp_path "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/install/python_loader/")
+ set(OpenCV_PYTHON_LOADER_FULL_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_PYTHON_INSTALL_PATH}/cv2")
if(IS_ABSOLUTE "${OPENCV_PYTHON_INSTALL_PATH}")
- set(OpenCV_PYTHON_INSTALL_PATH_RELATIVE_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/")
- set(CMAKE_PYTHON_EXTENSION_INSTALL_PATH_BASE "'${CMAKE_INSTALL_PREFIX}'")
+ set(CMAKE_PYTHON_EXTENSION_INSTALL_PATH_BASE "'${OPENCV_PYTHON_INSTALL_PATH}/cv2'")
else()
- file(RELATIVE_PATH OpenCV_PYTHON_INSTALL_PATH_RELATIVE_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/${OPENCV_PYTHON_INSTALL_PATH}/cv2" ${CMAKE_INSTALL_PREFIX})
- set(CMAKE_PYTHON_EXTENSION_INSTALL_PATH_BASE "os.path.join(LOADER_DIR, '${OpenCV_PYTHON_INSTALL_PATH_RELATIVE_CONFIGCMAKE}')")
+ set(CMAKE_PYTHON_EXTENSION_INSTALL_PATH_BASE "LOADER_DIR")
endif()
if(DEFINED ${PYTHON}_VERSION_MINOR)
@@ -167,7 +170,8 @@ if(NOT OPENCV_SKIP_PYTHON_LOADER)
if(IS_ABSOLUTE __python_binary_install_path)
set(CMAKE_PYTHON_EXTENSION_PATH "'${__python_binary_install_path}'")
else()
- set(CMAKE_PYTHON_EXTENSION_PATH "os.path.join(${CMAKE_PYTHON_EXTENSION_INSTALL_PATH_BASE}, '${__python_binary_install_path}')")
+ file(RELATIVE_PATH OpenCV_PYTHON_BINARY_RELATIVE_INSTALL_PATH "${OpenCV_PYTHON_LOADER_FULL_INSTALL_PATH}" "${CMAKE_INSTALL_PREFIX}/${__python_binary_install_path}")
+ set(CMAKE_PYTHON_EXTENSION_PATH "os.path.join(${CMAKE_PYTHON_EXTENSION_INSTALL_PATH_BASE}, '${OpenCV_PYTHON_BINARY_RELATIVE_INSTALL_PATH}')")
endif()
configure_file("${PYTHON_SOURCE_DIR}/package/template/config-x.y.py.in" "${__python_loader_install_tmp_path}/cv2/${__target_config}" @ONLY)
install(FILES "${__python_loader_install_tmp_path}/cv2/${__target_config}" DESTINATION "${OPENCV_PYTHON_INSTALL_PATH}/cv2/" COMPONENT python)

View File

@ -0,0 +1,28 @@
From c4419e4e65a8d9e0b5a15e9a5242453f261bee46 Mon Sep 17 00:00:00 2001
From: Alexander Alekhin <alexander.a.alekhin@gmail.com>
Date: Thu, 15 Nov 2018 06:54:35 +0000
Subject: [PATCH] cvv: repair build
---
modules/cvv/src/qtutil/filter/diffFilterWidget.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/cvv/src/qtutil/filter/diffFilterWidget.cpp b/modules/cvv/src/qtutil/filter/diffFilterWidget.cpp
index a555c84983..ca2964fd16 100644
--- a/modules/cvv/src/qtutil/filter/diffFilterWidget.cpp
+++ b/modules/cvv/src/qtutil/filter/diffFilterWidget.cpp
@@ -1,6 +1,5 @@
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
-#include <opencv2/imgproc/types_c.h>
#include <unordered_map>
@@ -14,6 +13,7 @@
namespace cvv
{
+using namespace cv;
namespace qtutil
{

View File

@ -0,0 +1,24 @@
--- ./modules/core/src/va_intel.cpp.orig 2018-12-02 02:08:43.105140530 +0000
+++ ./modules/core/src/va_intel.cpp 2018-12-02 02:44:51.917011656 +0000
@@ -340,8 +340,8 @@ static void copy_convert_yv12_to_bgr(con
1.5959997177f
};
- CV_CheckEQ(image.format.fourcc, VA_FOURCC_YV12, "Unexpected image format");
- CV_CheckEQ(image.num_planes, 3, "");
+ //CV_CheckEQ(image.format.fourcc, VA_FOURCC_YV12, "Unexpected image format");
+ //CV_CheckEQ(image.num_planes, 3, "");
const size_t srcOffsetY = image.offsets[0];
const size_t srcOffsetV = image.offsets[1];
@@ -417,8 +417,8 @@ static void copy_convert_bgr_to_yv12(con
-0.2909994125f, 0.438999176f, -0.3679990768f, -0.0709991455f
};
- CV_CheckEQ(image.format.fourcc, VA_FOURCC_YV12, "Unexpected image format");
- CV_CheckEQ(image.num_planes, 3, "");
+ //CV_CheckEQ(image.format.fourcc, VA_FOURCC_YV12, "Unexpected image format");
+ //CV_CheckEQ(image.num_planes, 3, "");
const size_t dstOffsetY = image.offsets[0];
const size_t dstOffsetV = image.offsets[1];

View File

@ -1,4 +1,4 @@
export VERSION=3.4.3
export VERSION=3.4.4
wget -c https://github.com/opencv/opencv/archive/${VERSION}/opencv-${VERSION}.tar.gz
tar xf opencv-${VERSION}.tar.gz

View File

@ -51,8 +51,8 @@
%global optflags %(echo %{optflags} -Wl,--as-needed )
Name: opencv
Version: 3.4.3
Release: 7%{?dist}
Version: 3.4.4
Release: 1%{?dist}
Summary: Collection of algorithms for computer vision
# This is normal three clause BSD.
License: BSD
@ -67,8 +67,9 @@ Source1: %{name}_contrib-clean-%{version}.tar.gz
# fix/simplify cmake config install location (upstreamable)
# https://bugzilla.redhat.com/1031312
Patch1: opencv-3.4.1-cmake_paths.patch
Patch10: https://github.com/opencv/opencv/commit/4910f16f16a0a0c2b456b14cbc3429c86f96a5f5.patch
Patch11: https://github.com/opencv/opencv_contrib/commit/6a01e96ce795ed003cf83a777ba65d6dd2d8afce.patch
Patch10: fix_support_YV12_too.patch
Patch11: https://github.com/opencv/opencv_contrib/pull/1905/commits/c4419e4e65a8d9e0b5a15e9a5242453f261bee46.patch
Patch12: https://github.com/opencv/opencv/pull/13254/commits/ad35b79e3f98b4ce30481e0299cca550ed77aef0.patch
BuildRequires: gcc-c++
BuildRequires: libtool
@ -173,6 +174,7 @@ This package contains the OpenCV C/C++ core libraries.
Summary: Development files for using the OpenCV library
Requires: %{name}%{_isa} = %{version}-%{release}
Requires: %{name}-contrib%{_isa} = %{version}-%{release}
Provides: bundled(quirc) = 1.0
%description devel
This package contains the OpenCV C/C++ library and header files, as well as
@ -233,22 +235,22 @@ to provide decent performance and stability.
%prep
%setup -q -a1
# we don't use pre-built contribs
mv 3rdparty/quirc/ .
rm -r 3rdparty/
mkdir 3rdparty/
mv quirc/ 3rdparty/
%patch1 -p1 -b .cmake_paths
%ifarch %{ix86} %{arm}
%patch10 -p1 -R -b .revert_support_YV12_too
%patch10 -p1 -b .fix_support_YV12_too
%endif
pushd %{name}_contrib-%{version}
# missing dependecies for dnn_modern module in Fedora (tiny-dnn)
#rm -r modules/dnn_modern/
%patch11 -p1 -b .Add_missing_multi-line_separator
%patch11 -p1 -b .cvv_repair_build
popd
# fix dos end of lines
#sed -i 's|\r||g' samples/c/adaptiveskindetector.cpp
%patch12 -p1 -b .fix_install_of_python_bindings
%build
# enabled by default if libraries are presents at build time:
@ -290,6 +292,9 @@ pushd build
-DENABLE_PYLINT=ON \
-DBUILD_PROTOBUF=OFF \
-DPROTOBUF_UPDATE_FILES=ON \
%{?with_opencl: -DOPENCL_INCLUDE_DIR=%{_includedir}/CL } \
%{!?with_opencl: -DWITH_OPENCL=OFF } \
-DOPENCV_SKIP_PYTHON_LOADER=ON \
-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-%{version}/modules \
-DWITH_LIBV4L=ON \
-DWITH_OPENMP=ON \
@ -298,8 +303,13 @@ pushd build
%{?with_libmfx: -DWITH_MFX=ON } \
%{?with_clp: -DWITH_CLP=ON } \
%{?with_va: -DWITH_VA=ON } \
%{!?with_vtk: -DWITH_VTK=OFF} \
..
# -DENABLE_CXX11=ON \
# -DPYTHON2_PACKAGES_PATH=%{python2_sitearch} \
# -DPYTHON3_PACKAGES_PATH=%{python3_sitearch} \
%make_build VERBOSE=1
popd
@ -375,6 +385,7 @@ popd
%{python2_sitearch}/cv2.so
%files -n python3-opencv
%{_bindir}/setup_vars_opencv3.sh
%{python3_sitearch}/cv2.cpython-3*.so
%files contrib
@ -410,6 +421,9 @@ popd
%{_libdir}/libopencv_xphoto.so.%{abiver}*
%changelog
* Sat Dec 01 2018 Sérgio Basto <sergio@serjux.com> - 3.4.4-1
- Update to 3.4.4
* Wed Nov 21 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.4.3-7
- Rebuild for protobuf 3.6

View File

@ -1,2 +1,2 @@
SHA512 (opencv_contrib-clean-3.4.3.tar.gz) = bc3f47ccc422b8e10be399b9b0293bc578d48ef3faad8a4e540cf1a2424364c99a834ebb250afb8f529442f5486e214a34a01e2eff89c1e409a028e18da11f43
SHA512 (opencv-clean-3.4.3.tar.gz) = 22a7632bbe3856531c579c464eb76e0e2239d303d7dd3081232005752600941311947ff02e6d0b75c3406ffdac9c7aa0791183404e9f573c999f80bfd563b469
SHA512 (opencv_contrib-clean-3.4.4.tar.gz) = ccb2fd7c3034e5c6e6d5065ee74a65ad4d4861a5683a81013cc93750de81d390ff2ad40ed65fcf54807090f67b136e6bb57cd9f1a435c49d5812d5380c062fd7
SHA512 (opencv-clean-3.4.4.tar.gz) = ee8cc8af5e8c6accb4593171c6e30848f91717d41143e74336934fa4eefe4a333623ce2cf54f663f4e70a86c2d637389d9d0636458c9d35e6a5bf75a4cd78b84