summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmy Winston <amynka@gentoo.org>2016-01-23 18:48:16 +0100
committerAmy Winston <amynka@gentoo.org>2016-01-23 18:51:07 +0100
commitf753262e119064afbaf11b171be9c33aff217557 (patch)
tree1b7031cb93810c50c3dccb66498b0d337cd0a8cc /media-libs/opencv
parentMerge remote-tracking branch 'github/pr/711'. (diff)
downloadgentoo-f753262e119064afbaf11b171be9c33aff217557.tar.gz
gentoo-f753262e119064afbaf11b171be9c33aff217557.tar.bz2
gentoo-f753262e119064afbaf11b171be9c33aff217557.zip
media-libs/opencv: 3.1.0 version bump bug #571496
Package-Manager: portage-2.2.24
Diffstat (limited to 'media-libs/opencv')
-rw-r--r--media-libs/opencv/Manifest1
-rw-r--r--media-libs/opencv/files/opencv-3.1.0-cmake-no-opengl.patch22
-rw-r--r--media-libs/opencv/files/opencv-3.1.0-fix-hal-headers.patch91
-rw-r--r--media-libs/opencv/files/opencv-3.1.0-fix-ocl-declaration.patch214
-rw-r--r--media-libs/opencv/files/opencv-3.1.0-invalid-string-usage.patch75
-rw-r--r--media-libs/opencv/metadata.xml2
-rw-r--r--media-libs/opencv/opencv-3.1.0.ebuild252
7 files changed, 657 insertions, 0 deletions
diff --git a/media-libs/opencv/Manifest b/media-libs/opencv/Manifest
index 57bffd8f3faa..86ee2a599465 100644
--- a/media-libs/opencv/Manifest
+++ b/media-libs/opencv/Manifest
@@ -2,4 +2,5 @@ DIST opencv-2.4.10.zip 91692581 SHA256 1bf4cb87283797fd91669d4f90b622a677a903c20
DIST opencv-2.4.11.zip 91671436 SHA256 af1952fd40fb0dc5e369725e073ac4650847e956fbf77c5f206b6da8ce2b1fea SHA512 748f6b939200a7ad2c2ae2531bf9bf38b82a576530f10691c13a0ad52568a7eb8b9d312e946ba8e78f592ef05ae389ecb982544f0c00cb83a2d87ae4b4da61b0 WHIRLPOOL 1c621b835fb144997ecbabddaa1b9a0cd0653e27c5a4f2abc43f3c6152a0b98eb0941d59263be33f69a6f3bccdffa484455c2ddaa747ed4a2bd2cd3192956d29
DIST opencv-2.4.9.zip 91684751 SHA256 803010848154988e9cbda8b3fa857fcbb27382c2946ed729e1a7e40600bb4c71 SHA512 8eb6ee11d8260428ae461e06348ce037979efc29b7e33d59c3d348a6b4bae95b7004df4527aba7c634e7356f7b5635c98493dc15a0b43479e8f10f7258540c62 WHIRLPOOL 5bb5e39678b3072b2e8b923216529c84982559dd69d5ec51b8703e65af3401f3a8ff31e4e3bfc076480d0605e333df0b03a61713a927ec058bfaf25b4fa8fd5e
DIST opencv-3.0.0.zip 100980799 SHA256 07094ea2f996f2622d572f0f3a162d698c8a547520341ca9109fbaf9363fb001 SHA512 108d0fdcc60b5688ebf61c930fb965ec81f0d3c36bb1797f6cc571fac35331f540773207fd1cb81b12c05c8f4d1af20c4a2452d9f75cd0cae4acd8131be92375 WHIRLPOOL 61cbbf5201b1dea75ffa998d1f55ee35f098bb8f76591cc9705de13b9f05eaefd19dcc74e93d2643d9b721e62483a36547617ec2e3d14fa6a2522e18ccf06747
+DIST opencv-3.1.0.zip 79186131 SHA256 1f6990249fdb82804fff40e96fa6d99949023ab0e3277eae4bd459b374e622a4 SHA512 b4915e8838fce8ba9e1af8b11e46678624435e9a41592e645413dfdc830993eaa017d337fe4c212a49f096421a6317a1892546087fbc3cfdab554522336c0f1a WHIRLPOOL 3c38715e2abc431781b724199c2cf06f844c7a889c51a06ecb64889a8ca36d9fd370a0738deec2995e24e453cb64f5db228238681714f62daf6eac50d95a4914
DIST opencv_contrib.zip 76144299 SHA256 ba780e61e9659aac299055d68c9fe40258e3fab7cb167892163eb5732387c4bb SHA512 9253a9d209368da5bea5f0138c55379132467b840d25fc5eaa1bc0103e6da61d6facf206456ff3f4bb68482d9c6381e23a566cb4dd155ac9ff9a259e54f7ffbf WHIRLPOOL 411febd3d5912ea28b570b217e3af41bee2d48daf5f47b0de6125b40cfbf435216c668545b3e0dfa48e4eef8d4a86135058ee72dc7b5a4244b661130a6916843
diff --git a/media-libs/opencv/files/opencv-3.1.0-cmake-no-opengl.patch b/media-libs/opencv/files/opencv-3.1.0-cmake-no-opengl.patch
new file mode 100644
index 000000000000..d6d70d717d3b
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.1.0-cmake-no-opengl.patch
@@ -0,0 +1,22 @@
+From cdb9c60dcb65e04e7c0bd6bef9b86841191c785a Mon Sep 17 00:00:00 2001
+From: Alexander Alekhin <alexander.alekhin@itseez.com>
+Date: Thu, 31 Dec 2015 02:24:54 +0300
+Subject: [PATCH] gpu samples: fix REMOVE_ITEM error
+
+---
+ samples/gpu/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/samples/gpu/CMakeLists.txt b/samples/gpu/CMakeLists.txt
+index 6085cac..852a8c2 100644
+--- a/samples/gpu/CMakeLists.txt
++++ b/samples/gpu/CMakeLists.txt
+@@ -97,7 +97,7 @@ endif()
+ if(INSTALL_C_EXAMPLES AND NOT WIN32)
+ file(GLOB install_list *.c *.cpp *.jpg *.png *.data makefile.* build_all.sh *.dsp *.cmd )
+ if(NOT WITH_OPENGL)
+- list(REMOVE_ITEM all_samples "opengl.cpp")
++ list(REMOVE_ITEM install_list "opengl.cpp")
+ endif(NOT WITH_OPENGL)
+ install(FILES ${install_list}
+ DESTINATION ${OPENCV_SAMPLES_SRC_INSTALL_PATH}/gpu
diff --git a/media-libs/opencv/files/opencv-3.1.0-fix-hal-headers.patch b/media-libs/opencv/files/opencv-3.1.0-fix-hal-headers.patch
new file mode 100644
index 000000000000..dd77571a60cf
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.1.0-fix-hal-headers.patch
@@ -0,0 +1,91 @@
+From f529a1df2b17bcada1179ddcaf1352e3a5ba97b8 Mon Sep 17 00:00:00 2001
+From: Maksim Shabunin <maksim.shabunin@itseez.com>
+Date: Tue, 15 Dec 2015 17:51:08 +0300
+Subject: [PATCH] Fixed HAL headers location
+
+diff --git opencv_contrib-master/modules/xfeatures2d/src/sift.cpp opencv_contrib-master/modules/xfeatures2d/src/sift.cpp
+index fc67c4d..9634fbb 100644
+--- opencv_contrib-master/modules/xfeatures2d/src/sift.cpp
++++ opencv_contrib-master/modules/xfeatures2d/src/sift.cpp
+@@ -105,6 +105,7 @@
+ #include "precomp.hpp"
+ #include <iostream>
+ #include <stdarg.h>
++#include <opencv2/core/hal/hal.hpp>
+
+ namespace cv
+ {
+@@ -337,9 +338,9 @@ static float calcOrientationHist( const Mat& img, Point pt, int radius,
+ len = k;
+
+ // compute gradient values, orientations and the weights over the pixel neighborhood
+- hal::exp(W, W, len);
+- hal::fastAtan2(Y, X, Ori, len, true);
+- hal::magnitude(X, Y, Mag, len);
++ cv::hal::exp32f(W, W, len);
++ cv::hal::fastAtan2(Y, X, Ori, len, true);
++ cv::hal::magnitude32f(X, Y, Mag, len);
+
+ for( k = 0; k < len; k++ )
+ {
+@@ -620,9 +621,9 @@ static void calcSIFTDescriptor( const Mat& img, Point2f ptf, float ori, float sc
+ }
+
+ len = k;
+- hal::fastAtan2(Y, X, Ori, len, true);
+- hal::magnitude(X, Y, Mag, len);
+- hal::exp(W, W, len);
++ cv::hal::fastAtan2(Y, X, Ori, len, true);
++ cv::hal::magnitude32f(X, Y, Mag, len);
++ cv::hal::exp32f(W, W, len);
+
+ for( k = 0; k < len; k++ )
+ {
+
+diff --git opencv_contrib-master/modules/optflow/src/motempl.cpp opencv_contrib-master/modules/optflow/src/motempl.cpp
+index ec18013..452ad63 100644
+--- opencv_contrib-master/modules/optflow/src/motempl.cpp
++++ opencv_contrib-master/modules/optflow/src/motempl.cpp
+@@ -41,6 +41,7 @@
+
+ #include "precomp.hpp"
+ #include "opencv2/core/utility.hpp"
++#include "opencv2/core/hal/hal.hpp"
+ #include "opencl_kernels_optflow.hpp"
+
+ namespace cv {
+@@ -212,7 +213,7 @@ void calcMotionGradient( InputArray _mhi, OutputArray _mask,
+ float* orient_row = orient.ptr<float>(y);
+ uchar* mask_row = mask.ptr<uchar>(y);
+
+- hal::fastAtan2(dY_max_row, dX_min_row, orient_row, size.width, true);
++ cv::hal::fastAtan2(dY_max_row, dX_min_row, orient_row, size.width, true);
+
+ // make orientation zero where the gradient is very small
+ for( x = 0; x < size.width; x++ )
+diff --git opencv_contrib-master/modules/ximgproc/src/fgs_filter.cpp opencv_contrib-master/modules/ximgproc/src/fgs_filter.cpp
+index e89eb8f..39307e5 100644
+--- opencv_contrib-master/modules/ximgproc/src/fgs_filter.cpp
++++ opencv_contrib-master/modules/ximgproc/src/fgs_filter.cpp
+@@ -35,7 +35,7 @@
+ */
+
+ #include "precomp.hpp"
+-#include "opencv2/hal/intrin.hpp"
++#include "opencv2/core/hal/intrin.hpp"
+ #include <vector>
+
+ namespace cv {
+diff --git opencv_contrib-master/modules/xphoto/src/grayworld_white_balance.cpp opencv_contrib-master/modules/xphoto/src/grayworld_white_balance.cpp
+index 4780497..15530d3 100644
+--- opencv_contrib-master/modules/xphoto/src/grayworld_white_balance.cpp
++++ opencv_contrib-master/modules/xphoto/src/grayworld_white_balance.cpp
+@@ -40,7 +40,7 @@
+ #include "opencv2/xphoto.hpp"
+
+ #include "opencv2/core.hpp"
+-#include "opencv2/hal/intrin.hpp"
++#include "opencv2/core/hal/intrin.hpp"
+
+ namespace cv { namespace xphoto {
+
diff --git a/media-libs/opencv/files/opencv-3.1.0-fix-ocl-declaration.patch b/media-libs/opencv/files/opencv-3.1.0-fix-ocl-declaration.patch
new file mode 100644
index 000000000000..e9a190c66324
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.1.0-fix-ocl-declaration.patch
@@ -0,0 +1,214 @@
+From ac8dd366e4a1877e0af16961a4094496bed955f7 Mon Sep 17 00:00:00 2001
+From: Alexander Alekhin <alexander.alekhin@itseez.com>
+Date: Sun, 13 Sep 2015 21:18:47 +0300
+Subject: [PATCH] ocl: fix "off" mode
+
+diff --git opencv_contrib-master/modules/tracking/src/tldDetector.cpp opencv_contrib-master/modules/tracking/src/tldDetector.cpp
+index cbb783e..d61444b 100644
+--- opencv_contrib-master/modules/tracking/src/tldDetector.cpp
++++ opencv_contrib-master/modules/tracking/src/tldDetector.cpp
+@@ -104,6 +104,7 @@ namespace cv
+ return splus / (sminus + splus);
+ }
+
++#ifdef HAVE_OPENCL
+ double TLDDetector::ocl_Sr(const Mat_<uchar>& patch)
+ {
+ //int64 e1, e2, e3, e4;
+@@ -283,6 +284,7 @@ namespace cv
+ //t = (e2 - e1) / getTickFrequency()*1000.0;
+ //printf("Sr GPU: %f\n\n", t);
+ }
++#endif
+
+ // Calculate Conservative similarity of the patch (NN-Model)
+ double TLDDetector::Sc(const Mat_<uchar>& patch)
+@@ -337,6 +339,7 @@ namespace cv
+ return splus / (sminus + splus);
+ }
+
++#ifdef HAVE_OPENCL
+ double TLDDetector::ocl_Sc(const Mat_<uchar>& patch)
+ {
+ //int64 e1, e2, e3, e4;
+@@ -415,6 +418,7 @@ namespace cv
+ return 0.0;
+ return splus / (sminus + splus);
+ }
++#endif // HAVE_OPENCL
+
+ // Generate Search Windows for detector from aspect ratio of initial BBs
+ void TLDDetector::generateScanGrid(int rows, int cols, Size initBox, std::vector<Rect2d>& res, bool withScaling)
+@@ -565,6 +569,7 @@ namespace cv
+ return true;
+ }
+
++#ifdef HAVE_OPENCL
+ bool TLDDetector::ocl_detect(const Mat& img, const Mat& imgBlurred, Rect2d& res, std::vector<LabeledPatch>& patches, Size initSize)
+ {
+ patches.clear();
+@@ -696,6 +701,7 @@ namespace cv
+ res = maxScRect;
+ return true;
+ }
++#endif // HAVE_OPENCL
+
+ // Computes the variance of subimage given by box, with the help of two integral
+ // images intImgP and intImgP2 (sum of squares), which should be also provided.
+diff --git opencv_contrib-master/modules/tracking/src/tldDetector.hpp opencv_contrib-master/modules/tracking/src/tldDetector.hpp
+index 3e11895..1caff57 100644
+--- opencv_contrib-master/modules/tracking/src/tldDetector.hpp
++++ opencv_contrib-master/modules/tracking/src/tldDetector.hpp
+@@ -74,10 +74,12 @@ namespace cv
+ inline double ensembleClassifierNum(const uchar* data);
+ inline void prepareClassifiers(int rowstep);
+ double Sr(const Mat_<uchar>& patch);
+- double ocl_Sr(const Mat_<uchar>& patch);
+ double Sc(const Mat_<uchar>& patch);
++#ifdef HAVE_OPENCL
++ double ocl_Sr(const Mat_<uchar>& patch);
+ double ocl_Sc(const Mat_<uchar>& patch);
+ void ocl_batchSrSc(const Mat_<uchar>& patches, double *resultSr, double *resultSc, int numOfPatches);
++#endif
+
+ std::vector<TLDEnsembleClassifier> classifiers;
+ Mat *posExp, *negExp;
+diff --git opencv_contrib-master/modules/tracking/src/tldModel.cpp opencv_contrib-master/modules/tracking/src/tldModel.cpp
+index 0854022..47fc32a 100644
+--- opencv_contrib-master/modules/tracking/src/tldModel.cpp
++++ opencv_contrib-master/modules/tracking/src/tldModel.cpp
+@@ -246,6 +246,7 @@ namespace cv
+ dfprintf((stdout, "\n"));*/
+ }
+
++#ifdef HAVE_OPENCL
+ void TrackerTLDModel::ocl_integrateAdditional(const std::vector<Mat_<uchar> >& eForModel, const std::vector<Mat_<uchar> >& eForEnsemble, bool isPositive)
+ {
+ int positiveIntoModel = 0, negativeIntoModel = 0, positiveIntoEnsemble = 0, negativeIntoEnsemble = 0;
+@@ -315,6 +316,7 @@ namespace cv
+ dfprintf((stdout, "positiveIntoEnsemble = %d ", positiveIntoEnsemble));
+ dfprintf((stdout, "\n"));*/
+ }
++#endif // HAVE_OPENCL
+
+ //Push the patch to the model
+ void TrackerTLDModel::pushIntoModel(const Mat_<uchar>& example, bool positive)
+diff --git opencv_contrib-master/modules/tracking/src/tldModel.hpp opencv_contrib-master/modules/tracking/src/tldModel.hpp
+index be9141a..ba7c926 100644
+--- opencv_contrib-master/modules/tracking/src/tldModel.hpp
++++ opencv_contrib-master/modules/tracking/src/tldModel.hpp
+@@ -58,7 +58,9 @@ namespace cv
+ void setBoudingBox(Rect2d boundingBox){ boundingBox_ = boundingBox; }
+ void integrateRelabeled(Mat& img, Mat& imgBlurred, const std::vector<TLDDetector::LabeledPatch>& patches);
+ void integrateAdditional(const std::vector<Mat_<uchar> >& eForModel, const std::vector<Mat_<uchar> >& eForEnsemble, bool isPositive);
++#ifdef HAVE_OPENCL
+ void ocl_integrateAdditional(const std::vector<Mat_<uchar> >& eForModel, const std::vector<Mat_<uchar> >& eForEnsemble, bool isPositive);
++#endif
+ Size getMinSize(){ return minSize_; }
+ void printme(FILE* port = stdout);
+ Ptr<TLDDetector> detector;
+diff --git opencv_contrib-master/modules/tracking/src/tldTracker.cpp opencv_contrib-master/modules/tracking/src/tldTracker.cpp
+index 0f1e2f7..a5190f5 100644
+--- opencv_contrib-master/modules/tracking/src/tldTracker.cpp
++++ opencv_contrib-master/modules/tracking/src/tldTracker.cpp
+@@ -123,9 +123,11 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
+
+ if (i == 1)
+ {
++#ifdef HAVE_OPENCL
+ if (ocl::haveOpenCL())
+ DETECT_FLG = tldModel->detector->ocl_detect(imageForDetector, image_blurred, tmpCandid, detectorResults, tldModel->getMinSize());
+ else
++#endif
+ DETECT_FLG = tldModel->detector->detect(imageForDetector, image_blurred, tmpCandid, detectorResults, tldModel->getMinSize());
+ }
+
+@@ -211,17 +213,21 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
+ tldModel->integrateRelabeled(imageForDetector, image_blurred, detectorResults);
+ //dprintf(("%d relabeled by nExpert\n", negRelabeled));
+ pExpert.additionalExamples(examplesForModel, examplesForEnsemble);
+- if (ocl::haveOpenCL())
+- tldModel->ocl_integrateAdditional(examplesForModel, examplesForEnsemble, true);
+- else
+- tldModel->integrateAdditional(examplesForModel, examplesForEnsemble, true);
++#ifdef HAVE_OPENCL
++ if (ocl::haveOpenCL())
++ tldModel->ocl_integrateAdditional(examplesForModel, examplesForEnsemble, true);
++ else
++#endif
++ tldModel->integrateAdditional(examplesForModel, examplesForEnsemble, true);
+ examplesForModel.clear(); examplesForEnsemble.clear();
+ nExpert.additionalExamples(examplesForModel, examplesForEnsemble);
+
+- if (ocl::haveOpenCL())
+- tldModel->ocl_integrateAdditional(examplesForModel, examplesForEnsemble, false);
+- else
+- tldModel->integrateAdditional(examplesForModel, examplesForEnsemble, false);
++#ifdef HAVE_OPENCL
++ if (ocl::haveOpenCL())
++ tldModel->ocl_integrateAdditional(examplesForModel, examplesForEnsemble, false);
++ else
++#endif
++ tldModel->integrateAdditional(examplesForModel, examplesForEnsemble, false);
+ }
+ else
+ {
+diff --git opencv_contrib-master/modules/xfeatures2d/src/surf.cpp opencv_contrib-master/modules/xfeatures2d/src/surf.cpp
+index 673817e..af5ceaf6 100644
+--- opencv_contrib-master/modules/xfeatures2d/src/surf.cpp
++++ opencv_contrib-master/modules/xfeatures2d/src/surf.cpp
+@@ -892,6 +892,7 @@ void SURF_Impl::detectAndCompute(InputArray _img, InputArray _mask,
+ CV_Assert(!_img.empty() && CV_MAT_DEPTH(imgtype) == CV_8U && (imgcn == 1 || imgcn == 3 || imgcn == 4));
+ CV_Assert(_descriptors.needed() || !useProvidedKeypoints);
+
++#ifdef HAVE_OPENCL
+ if( ocl::useOpenCL() )
+ {
+ SURF_OCL ocl_surf;
+@@ -918,6 +919,7 @@ void SURF_Impl::detectAndCompute(InputArray _img, InputArray _mask,
+ return;
+ }
+ }
++#endif // HAVE_OPENCL
+
+ Mat img = _img.getMat(), mask = _mask.getMat(), mask1, sum, msum;
+
+diff --git opencv_contrib-master/modules/xfeatures2d/src/surf.hpp opencv_contrib-master/modules/xfeatures2d/src/surf.hpp
+index 2c4e271..cf3fda1 100644
+--- opencv_contrib-master/modules/xfeatures2d/src/surf.hpp
++++ opencv_contrib-master/modules/xfeatures2d/src/surf.hpp
+@@ -64,6 +64,7 @@ class SURF_Impl : public SURF
+ bool upright;
+ };
+
++#ifdef HAVE_OPENCL
+ class SURF_OCL
+ {
+ public:
+@@ -145,6 +146,7 @@ class SURF_OCL
+
+ int status;
+ };
++#endif // HAVE_OPENCL
+
+ /*
+ template<typename _Tp> void copyVectorToUMat(const std::vector<_Tp>& v, UMat& um)
+diff --git opencv_contrib-master/modules/xfeatures2d/src/surf.ocl.cpp opencv_contrib-master/modules/xfeatures2d/src/surf.ocl.cpp
+index b12ebd3..3d9845d 100644
+--- opencv_contrib-master/modules/xfeatures2d/src/surf.ocl.cpp
++++ opencv_contrib-master/modules/xfeatures2d/src/surf.ocl.cpp
+@@ -43,6 +43,9 @@
+ //
+ //M*/
+ #include "precomp.hpp"
++
++#ifdef HAVE_OPENCL
++
+ #include "surf.hpp"
+
+ #include <cstdio>
+@@ -461,3 +464,4 @@ bool SURF_OCL::calcOrientation(UMat &keypoints)
+ }
+ }
+
++#endif // HAVE_OPENCL
diff --git a/media-libs/opencv/files/opencv-3.1.0-invalid-string-usage.patch b/media-libs/opencv/files/opencv-3.1.0-invalid-string-usage.patch
new file mode 100644
index 000000000000..c9f85a758583
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.1.0-invalid-string-usage.patch
@@ -0,0 +1,75 @@
+From 9862a8bac536981c1c1a74710741fb40db4beac7 Mon Sep 17 00:00:00 2001
+From: Alexander Alekhin <alexander.alekhin@itseez.com>
+Date: Wed, 23 Sep 2015 12:44:26 +0300
+Subject: [PATCH] fix invalid String usage
+
+---
+ modules/tracking/src/tldDetector.cpp | 6 +++---
+ modules/ximgproc/samples/live_demo.cpp | 12 ++++++------
+ 2 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git opencv_contrib-master/modules/tracking/src/tldDetector.cpp opencv_contrib-master/modules/tracking/src/tldDetector.cpp
+index cbb783e..0916092 100644
+--- opencv_contrib-master/modules/tracking/src/tldDetector.cpp
++++ opencv_contrib-master/modules/tracking/src/tldDetector.cpp
+@@ -122,7 +122,7 @@ namespace cv
+ ocl::Kernel k;
+ ocl::ProgramSource src = ocl::tracking::tldDetector_oclsrc;
+ String error;
+- ocl::Program prog(src, NULL, error);
++ ocl::Program prog(src, String(), error);
+ k.create("NCC", prog);
+ if (k.empty())
+ printf("Kernel create failed!!!\n");
+@@ -198,7 +198,7 @@ namespace cv
+ ocl::Kernel k;
+ ocl::ProgramSource src = ocl::tracking::tldDetector_oclsrc;
+ String error;
+- ocl::Program prog(src, NULL, error);
++ ocl::Program prog(src, String(), error);
+ k.create("batchNCC", prog);
+ if (k.empty())
+ printf("Kernel create failed!!!\n");
+@@ -355,7 +355,7 @@ namespace cv
+ ocl::Kernel k;
+ ocl::ProgramSource src = ocl::tracking::tldDetector_oclsrc;
+ String error;
+- ocl::Program prog(src, NULL, error);
++ ocl::Program prog(src, String(), error);
+ k.create("NCC", prog);
+ if (k.empty())
+ printf("Kernel create failed!!!\n");
+diff --git opencv_contrib-master/modules/ximgproc/samples/live_demo.cpp opencv_contrib-master/modules/ximgproc/samples/live_demo.cpp
+index dd5dc1b..8e16de3 100644
+--- opencv_contrib-master/modules/ximgproc/samples/live_demo.cpp
++++ opencv_contrib-master/modules/ximgproc/samples/live_demo.cpp
+@@ -189,7 +189,7 @@ int main()
+
+ //Thread trackbar
+ cv::setNumThreads(g_numberOfCPUs); //speedup filtering
+- createTrackbar("Threads", NULL, &g_numberOfCPUs, cv::getNumberOfCPUs(), changeNumberOfCpuCallback);
++ createTrackbar("Threads", String(), &g_numberOfCPUs, cv::getNumberOfCPUs(), changeNumberOfCpuCallback);
+
+ //Buttons to choose different modes
+ createButton("Mode Details Enhancement", changeModeCallback, (void*)filterDetailEnhancement, QT_RADIOBOX, true);
+@@ -199,15 +199,15 @@ int main()
+
+ //sliders for Details Enhancement mode
+ g_filterOp = filterDetailEnhancement; //set Details Enhancement as default filter
+- createTrackbar("Detail contrast", NULL, &g_contrastBase, 200);
+- createTrackbar("Detail level" , NULL, &g_detailsLevel, 200);
++ createTrackbar("Detail contrast", String(), &g_contrastBase, 200);
++ createTrackbar("Detail level" , String(), &g_detailsLevel, 200);
+
+ //sliders for Stylizing mode
+- createTrackbar("Style gamma", NULL, &g_edgesGamma, 300);
++ createTrackbar("Style gamma", String(), &g_edgesGamma, 300);
+
+ //sliders for every mode
+- createTrackbar("Sigma Spatial", NULL, &g_sigmaSpatial, 200);
+- createTrackbar("Sigma Color" , NULL, &g_sigmaColor, 200);
++ createTrackbar("Sigma Spatial", String(), &g_sigmaSpatial, 200);
++ createTrackbar("Sigma Color" , String(), &g_sigmaColor, 200);
+
+ Mat rawFrame, outputFrame;
+ Mat srcFrame, processedFrame;
diff --git a/media-libs/opencv/metadata.xml b/media-libs/opencv/metadata.xml
index 12a445a13b4a..eb2d81e28e2d 100644
--- a/media-libs/opencv/metadata.xml
+++ b/media-libs/opencv/metadata.xml
@@ -20,10 +20,12 @@ Face Recognition; Gesture Recognition; Motion Tracking, Ego Motion, Motion Under
<flag name="contrib">Install user contributed scripts from opencv_contrib</flag>
<flag name="cuda">Enable NVIDIA Cuda computations support</flag>
<flag name="eigen">Enable usage of <pkg>dev-cpp/eigen</pkg> for computations</flag>
+ <flag name="gdal">Enable support for sci-libs/gdal library</flag>
<flag name="ipp">Enable Intel Integrated Primitive support</flag>
<flag name="opencl">Add support for OpenCL</flag>
<flag name="testprograms">Build and install programs for testing OpenCV (performance)</flag>
<flag name="vtk">Build new 3D visualization module viz based on sci-libs/vtk</flag>
+ <flag name="webp">Enable support for webp image format</flag>
</use>
<upstream>
<remote-id type="sourceforge">opencvlibrary</remote-id>
diff --git a/media-libs/opencv/opencv-3.1.0.ebuild b/media-libs/opencv/opencv-3.1.0.ebuild
new file mode 100644
index 000000000000..1477ef37d039
--- /dev/null
+++ b/media-libs/opencv/opencv-3.1.0.ebuild
@@ -0,0 +1,252 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python{2_7,3_2,3_3,3_4} )
+
+inherit toolchain-funcs cmake-utils python-single-r1 java-pkg-opt-2 java-ant-2
+
+DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
+HOMEPAGE="http://opencv.org"
+
+SRC_URI="
+ mirror://sourceforge/opencvlibrary/opencv-unix/${PV}/${P}.zip
+ https://github.com/Itseez/${PN}/archive/${PV}.zip -> ${P}.zip
+ contrib? ( https://github.com/Itseez/${PN}_contrib/archive/${PV}.zip -> ${PN}_contrib.zip )"
+
+LICENSE="BSD"
+SLOT="0/3.0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-linux"
+IUSE="contrib cuda doc +eigen examples ffmpeg gdal gphoto2 gstreamer gtk ieee1394 ipp jpeg jpeg2k libav opencl openexr opengl openmp pch png +python qt4 qt5 testprograms threads tiff vaapi v4l vtk webp xine"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ ?? ( qt4 qt5 )
+"
+
+# The following logic is intrinsic in the build system, but we do not enforce
+# it on the useflags since this just blocks emerging pointlessly:
+# gtk? ( !qt4 )
+# opengl? ( || ( gtk qt4 ) )
+# openmp? ( !threads )
+
+RDEPEND="
+ app-arch/bzip2
+ sys-libs/zlib
+ cuda? ( >=dev-util/nvidia-cuda-toolkit-5.5 )
+ ffmpeg? (
+ libav? ( media-video/libav:0= )
+ !libav? ( media-video/ffmpeg:0= )
+ )
+ gdal? ( sci-libs/gdal )
+ gphoto2? ( media-libs/libgphoto2 )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ )
+ gtk? (
+ dev-libs/glib:2
+ x11-libs/gtk+:2
+ opengl? ( x11-libs/gtkglext )
+ )
+ java? ( >=virtual/jre-1.6:* )
+ jpeg? ( virtual/jpeg:0 )
+ jpeg2k? ( media-libs/jasper )
+ ieee1394? (
+ media-libs/libdc1394
+ sys-libs/libraw1394
+ )
+ ipp? ( sci-libs/ipp )
+ opencl? ( virtual/opencl )
+ openexr? ( media-libs/openexr )
+ opengl? ( virtual/opengl virtual/glu )
+ png? ( media-libs/libpng:0= )
+ python? ( ${PYTHON_DEPS} dev-python/numpy[${PYTHON_USEDEP}] )
+ qt4? (
+ dev-qt/qtgui:4
+ dev-qt/qttest:4
+ opengl? ( dev-qt/qtopengl:4 )
+ )
+ qt5? (
+ dev-qt/qtgui:5
+ dev-qt/qttest:5
+ dev-qt/qtconcurrent:5
+ opengl? ( dev-qt/qtopengl:5 )
+ )
+ threads? ( dev-cpp/tbb )
+ tiff? ( media-libs/tiff:0 )
+ v4l? ( >=media-libs/libv4l-0.8.3 )
+ vtk? ( sci-libs/vtk[rendering] )
+ webp? ( media-libs/libwebp )
+ xine? ( media-libs/xine-lib )
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ eigen? ( dev-cpp/eigen:3 )
+ java? ( >=virtual/jdk-1.6 )
+"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+
+ epatch "${FILESDIR}/${PN}-3.0.0-gles.patch" \
+ "${FILESDIR}/${PN}-3.1.0-cmake-no-opengl.patch"
+
+ # remove bundled stuff
+ rm -rf 3rdparty
+ sed -i \
+ -e '/add_subdirectory(.*3rdparty.*)/ d' \
+ CMakeLists.txt cmake/*cmake || die
+
+ if use contrib; then
+
+ cd "${WORKDIR}"
+ epatch "${FILESDIR}/${PN}-3.1.0-fix-hal-headers.patch" \
+ "${FILESDIR}/${PN}-3.1.0-fix-ocl-declaration.patch" \
+ "${FILESDIR}/${PN}-3.1.0-invalid-string-usage.patch"
+ fi
+
+ java-pkg-opt-2_src_prepare
+}
+
+src_configure() {
+ if use openmp; then
+ tc-has-openmp || die "Please switch to an openmp compatible compiler"
+ fi
+
+ JAVA_ANT_ENCODING="iso-8859-1"
+ # set encoding so even this cmake build will pick it up.
+ export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
+ java-ant-2_src_configure
+
+ # please dont sort here, order is the same as in CMakeLists.txt
+ local mycmakeargs=(
+ # the optinal dependency libraries
+ $(cmake-utils_use_with ieee1394 1394)
+ -DWITH_AVFOUNDATION=OFF # IOS
+ -DWITH_CARBON=OFF # APPLE
+ $(cmake-utils_use_with eigen)
+ $(cmake-utils_use_with ffmpeg)
+ -DWITH_VFW=OFF # video windows support
+ $(cmake-utils_use_with gstreamer)
+ -DWITH_GSTREAMER_0_10=OFF
+ $(cmake-utils_use_with gtk)
+ -DWITH_GTK_2_X=OFF
+ $(cmake-utils_use_with ipp)
+ $(cmake-utils_use_with java)
+ $(cmake-utils_use_with jpeg2k JASPER)
+ $(cmake-utils_use_with jpeg)
+ $(cmake-utils_use_with webp)
+ $(cmake-utils_use_with opencl)
+ $(cmake-utils_use_with gphoto2)
+ $(cmake-utils_use_with openexr)
+ $(cmake-utils_use_with opengl)
+ $(cmake-utils_use_with openmp)
+ -DWITH_OPENNI=OFF #not packaged
+ -DWITH_OPENNI2=OFF #not packaged
+ $(cmake-utils_use_with png)
+ $(cmake-utils_use_build python opencv_python)
+ -DWITH_PVAPI=OFF # not packaged
+ -DWITH_GIGEAPI=OFF
+ -DWITH_QUICKTIME=OFF
+ -DWITH_WIN32UI=OFF
+ $(cmake-utils_use_with threads TBB)
+ -DWITH_CSTRIPES=OFF
+ -DWITH_PTHREADS_PF=ON
+ $(cmake-utils_use_with tiff)
+ -DWITH_UNICAP=OFF # not packaged
+ $(cmake-utils_use_with v4l V4L)
+ $(cmake-utils_use_with vtk VTK)
+ -DWITH_LIBV4L=ON
+ -DWITH_DSHOW=ON # direct show supp
+ -DWITH_MSMF=OFF
+ -DWITH_VIDEOINPUT=OFF # windows only
+ -DWITH_XIMEA=OFF # windows only
+ $(cmake-utils_use_with xine)
+ -DWITH_CLP=OFF
+ $(cmake-utils_use_with opencl)
+ -DWITH_OPENCL_SVM=OFF
+ $(cmake-utils_use_with opencl OPENCLAMDFFT)
+ $(cmake-utils_use_with opencl OPENCLAMDBLAS)
+ -DWITH_DIRECTX=OFF
+ -DWITH_INTELPERC=OFF
+ -DWITH_IPP_A=OFF
+ -DWITH_MATLAB=ON #default
+ $(cmake-utils_use_with vaapi VA)
+ $(cmake-utils_use_with vaapi VA_INTEL)
+ $(cmake-utils_use_with gdal gdal)
+ #
+ # OpenCV build components
+ -DBUILD_SHARED_LIBS=ON
+ -DBUILD_ANDROID_EXAMPLES=OFF
+ $(cmake-utils_use_build doc DOCS)
+ $(cmake-utils_use_build examples)
+ $(cmake-utils_use_build java opencv_java) #for -java bug #555650
+ -DBUILD_PERF_TESTS=OFF
+ $(cmake-utils_use_build testprograms TESTS)
+ # install examples, tests etc
+ $(cmake-utils_use examples INSTALL_C_EXAMPLES)
+ $(cmake-utils_use testprograms INSTALL_TESTS)
+ # build options
+ $(cmake-utils_use_enable pch PRECOMPILED_HEADERS)
+ -DOPENCV_EXTRA_FLAGS_RELEASE="" # black magic
+ )
+
+ if use qt4; then
+ mycmakeargs+=( "-DWITH_QT=4" )
+ elif use qt5; then
+ mycmakeargs+=( "-DWITH_QT=5" )
+ else
+ mycmakeargs+=( "-DWITH_QT=OFF" )
+ fi
+
+ if use contrib; then
+ mycmakeargs+=( "-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-master/modules" )
+ fi
+
+ if use cuda; then
+ mycmakeargs+=( "-DWITH_CUDA=ON" )
+ mycmakeargs+=( "-DWITH_CUBLAS=ON" )
+ mycmakeargs+=( "-DWITH_CUFFT=ON" )
+ mycmakeargs+=( "-DWITH_NVCUVID=ON" ) #Nvidia video decoding library supp
+ else
+ mycmakeargs+=( "-DWITH_CUDA=OFF" )
+ mycmakeargs+=( "-DWITH_CUBLAS=OFF" )
+ mycmakeargs+=( "-DWITH_CUFFT=OFF" )
+ mycmakeargs+=( "-DWITH_NVCUVID=OFF" )
+ fi
+
+ if use examples && use python; then
+ mycmakeargs+=( "-DINSTALL_PYTHON_EXAMPLES=ON" )
+ else
+ mycmakeargs+=( "-DINSTALL_PYTHON_EXAMPLES=OFF" )
+ fi
+
+ # things we want to be hard off or not yet figured out
+ mycmakeargs+=(
+ "-DOPENCV_BUILD_3RDPARTY_LIBS=OFF"
+ "-DBUILD_LATEX_DOCS=OFF"
+ "-DBUILD_PACKAGE=OFF"
+ "-DENABLE_PROFILING=OFF"
+ )
+
+ # things we want to be hard enabled not worth useflag
+ mycmakeargs+=(
+ "-DCMAKE_SKIP_RPATH=ON"
+ "-DOPENCV_DOC_INSTALL_PATH=${EPREFIX}/usr/share/doc/${PF}"
+ )
+
+ # hardcode cuda paths
+ mycmakeargs+=(
+ "-DCUDA_NPP_LIBRARY_ROOT_DIR=/opt/cuda"
+ )
+
+ # workaround for bug 413429
+ tc-export CC CXX
+
+ cmake-utils_src_configure
+}