summaryrefslogtreecommitdiff
path: root/graphics/digikam/opencv.patch
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/digikam/opencv.patch')
-rw-r--r--graphics/digikam/opencv.patch121
1 files changed, 121 insertions, 0 deletions
diff --git a/graphics/digikam/opencv.patch b/graphics/digikam/opencv.patch
new file mode 100644
index 0000000000..029f5cdc4d
--- /dev/null
+++ b/graphics/digikam/opencv.patch
@@ -0,0 +1,121 @@
+diff -up digikam-4.12.0/core/app/utils/libopencv.h.opencv3 digikam-4.12.0/core/app/utils/libopencv.h
+--- digikam-4.12.0/core/app/utils/libopencv.h.opencv3 2015-08-18 15:32:24.635326685 +0200
++++ digikam-4.12.0/core/app/utils/libopencv.h 2015-08-18 16:51:00.716761209 +0200
+@@ -46,17 +46,19 @@
+
+ #define OPENCV_MAKE_VERSION(major,minor,patch) (((major) << 16) | ((minor) << 8) | (patch))
+ #define OPENCV_VERSION OPENCV_MAKE_VERSION(CV_MAJOR_VERSION,CV_MINOR_VERSION,CV_SUBMINOR_VERSION)
+-#define OPENCV_TEST_VERSION(major,minor,patch) ( OPENCV_VERSION >= OPENCV_MAKE_VERSION(major,minor,patch) )
++#define OPENCV_TEST_VERSION(major,minor,patch) ( OPENCV_VERSION < OPENCV_MAKE_VERSION(major,minor,patch) )
+
+-#if OPENCV_TEST_VERSION(2,3,0)
++#if OPENCV_TEST_VERSION(2,5,0)
+ # include <opencv2/opencv.hpp>
+ # include <opencv2/legacy/compat.hpp>
+ # include <opencv/cvaux.h>
++# include <opencv2/imgproc/imgproc.hpp>
+ #else
+ # include <opencv/cv.h>
+ # include <opencv/cvaux.h>
+ # include <opencv/cxcore.h>
+ # include <opencv/highgui.h>
++# include <opencv2/imgproc.hpp>
+ #endif
+
+ // Restore warnings
+diff -up digikam-4.12.0/core/libs/database/imgqsort/imgqsort.cpp.opencv3 digikam-4.12.0/core/libs/database/imgqsort/imgqsort.cpp
+--- digikam-4.12.0/core/libs/database/imgqsort/imgqsort.cpp.opencv3 2015-08-18 17:17:24.003431310 +0200
++++ digikam-4.12.0/core/libs/database/imgqsort/imgqsort.cpp 2015-08-18 17:25:14.761703338 +0200
+@@ -284,8 +284,8 @@ void ImgQSort::readImage() const
+ mixer.startFilterDirectly();
+
+ d->image.putImageData(mixer.getTargetImage().bits());
+- d->src = cvCreateMat(d->image.numPixels(), 3, CV_8UC3); // Create a matrix containing the pixel values of original image
+- d->src_gray = cvCreateMat(d->image.numPixels(), 1, CV_8UC1); // Create a matrix containing the pixel values of grayscaled image
++ d->src = Mat(d->image.numPixels(), 3, CV_8UC3); // Create a matrix containing the pixel values of original image
++ d->src_gray = Mat(d->image.numPixels(), 1, CV_8UC1); // Create a matrix containing the pixel values of grayscaled image
+
+ if (d->imq.detectNoise)
+ {
+@@ -660,7 +660,7 @@ int ImgQSort::compressiondetector() cons
+ int countblocks = 0;
+ int number_of_blocks = 0;
+ int sum = 0;
+- vector<int> average_bottom, average_middle, average_top;
++ std::vector<int> average_bottom, average_middle, average_top;
+
+ // Go through 8 blocks at a time horizontally
+ // iterating through columns.
+@@ -797,7 +797,7 @@ int ImgQSort::compressiondetector() cons
+ int ImgQSort::exposureamount() const
+ {
+ /// Separate the image in 3 places ( B, G and R )
+- vector<Mat> bgr_planes;
++ std::vector<Mat> bgr_planes;
+ split(d->src, bgr_planes);
+
+ /// Establish the number of bins
+diff -up digikam-4.12.0/core/libs/database/imgqsort/imgqsort.h.opencv3 digikam-4.12.0/core/libs/database/imgqsort/imgqsort.h
+--- digikam-4.12.0/core/libs/database/imgqsort/imgqsort.h.opencv3 2015-08-18 17:17:54.923383497 +0200
++++ digikam-4.12.0/core/libs/database/imgqsort/imgqsort.h 2015-08-18 17:27:54.225449446 +0200
+@@ -25,6 +25,10 @@
+ #ifndef IMGQSORT_H
+ #define IMGQSORT_H
+
++// Global includes
++
++#include <vector>
++
+ // Local includes
+
+ #include "dimg.h"
+diff -up digikam-4.12.0/extra/kipi-plugins/removeredeyes/detection/locators/haarclassifier/haarclassifierlocator.cpp.opencv3 digikam-4.12.0/extra/kipi-plugins/removeredeyes/detection/locators/haarclassifier/haarclassifierlocator.cpp
+--- digikam-4.12.0/extra/kipi-plugins/removeredeyes/detection/locators/haarclassifier/haarclassifierlocator.cpp.opencv3 2015-08-18 16:06:08.240514617 +0200
++++ digikam-4.12.0/extra/kipi-plugins/removeredeyes/detection/locators/haarclassifier/haarclassifierlocator.cpp 2015-08-18 16:19:07.774476511 +0200
+@@ -89,6 +89,13 @@ const QString HaarClassifierLocator::Pri
+ const QString HaarClassifierLocator::Private::configClassifierEntry("Classifier");
+
+ // --------------------------------------------------------
++#if !(OPENCV_TEST_VERSION(2,5,0))
++static void cvFillImage( CvArr* mat, double color)
++{
++ cvSet( mat, cvColorToScalar(color, cvGetElemType(mat)), 0);
++}
++#endif
++
+
+ int HaarClassifierLocator::findPossibleEyes(double csf, int ngf, const char* classifierFile)
+ {
+diff -up digikam-4.12.0/extra/kipi-plugins/removeredeyes/plugin/libopencv.h.opencv3 digikam-4.12.0/extra/kipi-plugins/removeredeyes/plugin/libopencv.h
+--- digikam-4.12.0/extra/kipi-plugins/removeredeyes/plugin/libopencv.h.opencv3 2015-08-18 13:43:10.380772123 +0200
++++ digikam-4.12.0/extra/kipi-plugins/removeredeyes/plugin/libopencv.h 2015-08-18 14:18:27.999977347 +0200
+@@ -53,12 +53,13 @@
+
+ #define OPENCV_MAKE_VERSION(major,minor,patch) (((major) << 16) | ((minor) << 8) | (patch))
+ #define OPENCV_VERSION OPENCV_MAKE_VERSION(CV_MAJOR_VERSION,CV_MINOR_VERSION,CV_SUBMINOR_VERSION)
+-#define OPENCV_TEST_VERSION(major,minor,patch) ( OPENCV_VERSION >= OPENCV_MAKE_VERSION(major,minor,patch) )
++#define OPENCV_TEST_VERSION(major,minor,patch) ( OPENCV_VERSION < OPENCV_MAKE_VERSION(major,minor,patch) )
+
+-#if OPENCV_TEST_VERSION(2,3,0)
++#include <opencv2/core/core_c.h>
++
++#if OPENCV_TEST_VERSION(2,5,0)
+ #include <opencv2/opencv.hpp>
+ #include <opencv2/highgui/highgui_c.h>
+-#include <opencv2/core/core_c.h>
+ #include <opencv2/legacy/compat.hpp>
+ #include <opencv/cvaux.h>
+ #else
+diff -up digikam-4.12.0/extra/kipi-plugins/removeredeyes/test/CMakeLists.txt.opencv3 digikam-4.12.0/extra/kipi-plugins/removeredeyes/test/CMakeLists.txt
+--- digikam-4.12.0/extra/kipi-plugins/removeredeyes/test/CMakeLists.txt.opencv3 2015-08-18 15:08:31.973733608 +0200
++++ digikam-4.12.0/extra/kipi-plugins/removeredeyes/test/CMakeLists.txt 2015-08-18 15:22:40.113991709 +0200
+@@ -4,7 +4,7 @@
+ # Redistribution and use is allowed according to the terms of the BSD license.
+ # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+-if(NOT WIN32)
++if(NOT WIN32 AND (${OpenCV_VERSION} VERSION_LESS 3.0.0))
+
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../plugin
+ ${CMAKE_CURRENT_SOURCE_DIR}/../libcvblobs
+