Hello community,
here is the log from the commit of package frei0r-plugins for openSUSE:Factory checked in at 2016-03-05 11:21:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/frei0r-plugins (Old)
and /work/SRC/openSUSE:Factory/.frei0r-plugins.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "frei0r-plugins"
Changes:
--------
--- /work/SRC/openSUSE:Factory/frei0r-plugins/frei0r-plugins.changes 2015-11-18 22:32:52.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.frei0r-plugins.new/frei0r-plugins.changes 2016-03-05 11:21:39.000000000 +0100
@@ -1,0 +2,18 @@
+Fri Mar 4 11:27:59 UTC 2016 - olaf@aepfle.de
+
+- Fix frei0r-plugins-openCV-3.0-compatibility.patch
+
+-------------------------------------------------------------------
+Fri Mar 4 10:52:06 UTC 2016 - zaitor@opensuse.org
+
+- Update Url to http://frei0r.dyne.org/, show that we are using the
+ fork and not the original frei0r.
+
+-------------------------------------------------------------------
+Thu Mar 3 14:17:10 UTC 2016 - tittiatcoke@gmail.com
+
+- Add frei0r-plugins-openCV-3.0-compatibility.patch: fix the
+ compilation against OpenCV 3. This patch is based on the two
+ upstream commits 129eea and 7ed3f84e6.
+
+-------------------------------------------------------------------
New:
----
frei0r-plugins-openCV-3.0-compatibility.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ frei0r-plugins.spec ++++++
--- /var/tmp/diff_new_pack.zQJWYh/_old 2016-03-05 11:21:40.000000000 +0100
+++ /var/tmp/diff_new_pack.zQJWYh/_new 2016-03-05 11:21:40.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package frei0r-plugins
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -22,12 +22,17 @@
Summary: Collection of video sources and filters plugins
License: GPL-2.0+
Group: Productivity/Multimedia/Video/Editors and Convertors
-Url: http://www.piksel.org/frei0r
+Url: http://frei0r.dyne.org/
Source: http://files.dyne.org/frei0r/releases/frei0r-plugins-%{version}.tar.gz
# PATCH-FIX-UPSTREAM frei0r-plugins-1.4-missing_include.patch http://www.piksel.no/projects/frei0r/ticket/41 reddwarf@opensuse.org -- Add missing header
Patch0: frei0r-plugins-1.4-missing_include.patch
+# PATCH-FIX-UPSTREAM frei0r-plugins-openCV-3.0-compatibility.patch tittiatcoke@gmail.com -- Make it compile with openCV3. This is a rebase of the two usptream commits by Dan Dennedy
+Patch1: frei0r-plugins-openCV-3.0-compatibility.patch
BuildRequires: gcc-c++
# For the automatic pkgconfig() Provides
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: libtool
BuildRequires: pkg-config
BuildRequires: pkgconfig(cairo) >= 1.0.0
BuildRequires: pkgconfig(gavl) >= 0.2.3
@@ -56,10 +61,13 @@
%prep
%setup -q
%patch0
+%patch1 -p1
# Timestamp problem. Remove in next release.
touch include/config.h.in
%build
+find -name Makefile.in -delete
+autoreconf -fi
%configure
make %{?_smp_mflags}
++++++ frei0r-plugins-openCV-3.0-compatibility.patch ++++++
---
src/Makefile.am | 2
src/filter/facedetect/facedetect.c | 266 -----------------------------------
src/filter/facedetect/facedetect.cpp | 19 ++
3 files changed, 19 insertions(+), 268 deletions(-)
Index: frei0r-plugins-1.4/src/Makefile.am
===================================================================
--- frei0r-plugins-1.4.orig/src/Makefile.am
+++ frei0r-plugins-1.4/src/Makefile.am
@@ -153,7 +153,7 @@ facebl0r_la_CFLAGS = @OPENCV_CFLAGS@ @CF
facebl0r_la_LIBADD = @OPENCV_LIBS@
plugin_LTLIBRARIES += facedetect.la
facedetect_la_SOURCES = filter/facedetect/facedetect.cpp
-facedetect_la_CFLAGS = @OPENCV_CFLAGS@ @CFLAGS@
+facedetect_la_CPPFLAGS = @OPENCV_CFLAGS@ @CFLAGS@
facedetect_la_LIBADD = @OPENCV_LIBS@
endif
Index: frei0r-plugins-1.4/src/filter/facedetect/facedetect.c
===================================================================
--- frei0r-plugins-1.4.orig/src/filter/facedetect/facedetect.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/**
- * binarymillenium 2007
- *
- * This code is released under the GPL
- *
- * *
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-#include "cv.h"
-//#include "highgui.h"
-
-#include "frei0r.h"
-
-#ifdef _EiC
-#define WIN32
-#endif
-
-
-CvSeq* detect_and_draw( IplImage* img, CvMemStorage* storage,
- CvHaarClassifierCascade* cascade);
-
-#ifndef OPENCV_PREFIX
-#error OPENCV_PREFIX must contain the installation prefix of OpenCV
-#endif
-
-#define STR(x) #x
-#define TOSTR(x) STR(x)
-
-static const char* const cascade_name =
- TOSTR(OPENCV_PREFIX)"/share/opencv/haarcascades/haarcascade_frontalface_alt2.xml";
-/* "haarcascade_frontalface_alt.xml";*/
-/* "haarcascade_profileface.xml";*/
-
-
-typedef struct facedetect_instance{
-
- IplImage *frame, *frame_copy;
-
- int width;
- int height;
-
- CvMemStorage* storage;
- CvHaarClassifierCascade* cascade;
-
-} facedetect_instance_t;
-
-int f0r_init()
-{
- return 1;
-}
-
-f0r_instance_t f0r_construct(unsigned int width, unsigned int height)
-{
- facedetect_instance_t* inst =
- (facedetect_instance_t*)malloc(sizeof(facedetect_instance_t));
-
- inst->width = width;
- inst->height = height;
-
- /// tbd - put this in init instead?
- inst->storage = 0;
- inst->cascade = 0;
-
- inst->frame = 0;
- inst->frame_copy = 0;
-
- inst->cascade = (CvHaarClassifierCascade*)cvLoad( cascade_name, 0, 0, 0 );
-
- if( !inst->cascade )
- {
- fprintf(stderr, "ERROR: Could not load classifier cascade %s\n",
- cascade_name);
- free(inst);
- return (f0r_instance_t)0;
- }
- else
- {
- inst->storage = cvCreateMemStorage(0);
-
- //cvNamedWindow( "result", 1 );
-
- return (f0r_instance_t)inst;
- }
-}
-
-
-void f0r_deinit()
-{
-}
-
-void f0r_destruct(f0r_instance_t instance)
-{
- free(instance);
- //cvDestroyWindow("result");
-}
-
-void f0r_set_param_value(f0r_instance_t instance,
- f0r_param_t param, int param_index)
-{
-}
-
-void f0r_get_param_value(f0r_instance_t instance,
- f0r_param_t param, int param_index)
-{
-}
-
-void f0r_get_plugin_info(f0r_plugin_info_t* facedetectInfo)
-{
- facedetectInfo->name = "opencvfacedetect";
- facedetectInfo->author = "binarymillenium";
- facedetectInfo->plugin_type = F0R_PLUGIN_TYPE_FILTER;
- facedetectInfo->color_model = F0R_COLOR_MODEL_BGRA8888;
- facedetectInfo->frei0r_version = FREI0R_MAJOR_VERSION;
- facedetectInfo->major_version = 0;
- facedetectInfo->minor_version = 1;
- facedetectInfo->num_params = 1;
- facedetectInfo->explanation = "detect faces";
-}
-
-void f0r_get_param_info(f0r_param_info_t* info, int param_index)
-{
- switch(param_index)
- {
- case 0:
- info->name = "test";
- info->type = F0R_PARAM_DOUBLE;
- info->explanation = "test";
- break;
- }
-
-}
-
-void f0r_update(f0r_instance_t instance, double time,
- const uint32_t* inframe, uint32_t* outframe)
-{
- assert(instance);
-
- facedetect_instance_t* inst = (facedetect_instance_t*)instance;
-
- unsigned char* dst = (unsigned char*)outframe;
- const unsigned char* src = (unsigned char*)inframe;
-
-
- if( !inst->frame_copy )
- inst->frame_copy = cvCreateImage( cvSize(inst->width,inst->height),
- IPL_DEPTH_8U, 4 );
-
- unsigned char* ipli = (unsigned char*)inst->frame_copy->imageData;
- int step = inst->frame_copy->widthStep;
- unsigned i, j;
- for (i = 0; (i < inst->height); i++) {
- for (j = 0; (j < inst->width); j++) {
- ipli[i*step+j*4+2] = src[2];
- ipli[i*step+j*4+1] = src[1];
- ipli[i*step+j*4+0] = src[0];
-
- //ipli += 4;
- src += 4;
-
- }
-
- }
-
- /*CvSeq* faces =*/ detect_and_draw( inst->frame_copy,
- inst->storage,
- inst->cascade );
-
- ipli = (unsigned char*)inst->frame_copy->imageData;
-
- for (i = 0; (i < inst->height); i++) {
- for (j = 0; (j < inst->width); j++) {
- dst[2] = ipli[2];
- dst[1] = ipli[1];
- dst[0] = ipli[0];
-
- ipli += 4;
- dst += 4;
- }
- }
-
- cvReleaseImage( &(inst->frame_copy) );
-
-}
-
-CvSeq* detect_and_draw( IplImage* img, CvMemStorage* storage,
- CvHaarClassifierCascade* cascade)
-{
- static CvScalar colors[] =
- {
- {{255,255,255}},
- {{0,128,255}},
- {{0,255,255}},
- {{0,255,0}},
- {{255,128,0}},
- {{255,255,0}},
- {{255,0,0}},
- {{255,0,255}},
- {{0,0,0}}
- };
-
- double scale = 1.3;
- IplImage* gray = cvCreateImage( cvSize(img->width,img->height), 8, 1 );
- IplImage* small_img = cvCreateImage( cvSize( cvRound (img->width/scale),
- cvRound (img->height/scale)),
- 8, 1 );
- int i;
-
- cvCvtColor( img, gray, CV_BGR2GRAY );
- cvResize( gray, small_img, CV_INTER_LINEAR );
- cvEqualizeHist( small_img, small_img );
- //cvClearMemStorage( storage );
-
- CvSeq* faces = 0;
-
- if( cascade )
- {
- double t = (double)cvGetTickCount();
- faces = cvHaarDetectObjects( small_img, cascade, storage,
- 1.1, 2, 0/*CV_HAAR_DO_CANNY_PRUNING*/,
- cvSize(30, 30) );
- t = (double)cvGetTickCount() - t;
- //printf( "detection time = %gms\n", t/((double)cvGetTickFrequency()*1000.) );
-
- CvPoint pt1, pt2;
- pt1.x = 0;
- pt1.y = 0;
- pt2.x = img->width;
- pt2.y = img->height;
- cvRectangle( img, pt1, pt2, colors[8],CV_FILLED, 8, 0 );
-
- for( i = 0; i < (faces ? faces->total : 0); i++ )
- {
- CvRect* r = (CvRect*)cvGetSeqElem( faces, i );
- CvPoint center;
- int radius;
- center.x = cvRound((r->x + r->width*0.5)*scale);
- center.y = cvRound((r->y + r->height*0.5)*scale);
- radius = cvRound((r->width + r->height)*0.25*scale);
-
- pt1.x = r->x;// - r->width*0.5;
- pt1.y = r->y;// - r->height*0.5;
- pt2.x = r->x + r->width;
- pt2.y = r->y + r->height;
- //printf( " faces %d %d \n", center.x, center.y);
- cvCircle( img, center, radius, colors[i%8],CV_FILLED, 8, 0); // 3, 8, 0 );
- //cvRectangle( img, pt1, pt2, colors[i%8], CV_FILLED );
- }
- }
-
- //cvShowImage( "result", img );
- cvReleaseImage( &gray );
- cvReleaseImage( &small_img );
-
- return faces;
-}
Index: frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp
===================================================================
--- frei0r-plugins-1.4.orig/src/filter/facedetect/facedetect.cpp
+++ frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp
@@ -25,7 +25,7 @@
#include
#include
#include
-#include
+#include
#include "frei0r.hpp"
#include "frei0r_math.h"
@@ -259,11 +259,19 @@ private:
{
double scale = this->scale == 0? 1.0 : this->scale;
CvScalar colors[5] = {
+#if defined(CV_MAJOR_VERSION) && (CV_MAJOR_VERSION >= 3)
+ CvScalar(cvRound(color[0].r * 255), cvRound(color[0].g * 255), cvRound(color[0].b * 255), cvRound(alpha * 255)),
+ CvScalar(cvRound(color[1].r * 255), cvRound(color[1].g * 255), cvRound(color[1].b * 255), cvRound(alpha * 255)),
+ CvScalar(cvRound(color[2].r * 255), cvRound(color[2].g * 255), cvRound(color[2].b * 255), cvRound(alpha * 255)),
+ CvScalar(cvRound(color[3].r * 255), cvRound(color[3].g * 255), cvRound(color[3].b * 255), cvRound(alpha * 255)),
+ CvScalar(cvRound(color[4].r * 255), cvRound(color[4].g * 255), cvRound(color[4].b * 255), cvRound(alpha * 255)),
+#else
{{cvRound(color[0].r * 255), cvRound(color[0].g * 255), cvRound(color[0].b * 255), cvRound(alpha * 255)}},
{{cvRound(color[1].r * 255), cvRound(color[1].g * 255), cvRound(color[1].b * 255), cvRound(alpha * 255)}},
{{cvRound(color[2].r * 255), cvRound(color[2].g * 255), cvRound(color[2].b * 255), cvRound(alpha * 255)}},
{{cvRound(color[3].r * 255), cvRound(color[3].g * 255), cvRound(color[3].b * 255), cvRound(alpha * 255)}},
{{cvRound(color[4].r * 255), cvRound(color[4].g * 255), cvRound(color[4].b * 255), cvRound(alpha * 255)}},
+#endif
};
for (int i = 0; i < (objects ? objects->total : 0); i++)
@@ -287,14 +295,23 @@ private:
}
case 1:
{
+#if defined(CV_MAJOR_VERSION) && (CV_MAJOR_VERSION >= 3)
+ CvBox2D box = CvBox2D(CvPoint2D32f(center.x, center.y), CvSize2D32f(r->width / scale, (r->height / scale) * 1.2), 90);
+#else
CvBox2D box = {{center.x, center.y}, {r->width / scale, (r->height / scale) * 1.2}, 90};
+#endif
cvEllipseBox(image, box, colors[i % 5], thickness, linetype);
break;
}
case 2:
{
+#if defined(CV_MAJOR_VERSION) && (CV_MAJOR_VERSION >= 3)
+ CvPoint pt1 = CvPoint(r->x / scale, r->y / scale);
+ CvPoint pt2 = CvPoint((r->x + r->width) / scale, (r->y + r->height) / scale);
+#else
CvPoint pt1 = {r->x / scale, r->y / scale};
CvPoint pt2 = {(r->x + r->width) / scale, (r->y + r->height) / scale};
+#endif
cvRectangle(image, pt1, pt2, colors[i % 5], thickness, linetype);
break;
}