* [gentoo-commits] repo/gentoo:master commit in: media-plugins/frei0r-plugins/files/
@ 2015-11-05 15:55 Alexis Ballier
0 siblings, 0 replies; 3+ messages in thread
From: Alexis Ballier @ 2015-11-05 15:55 UTC (permalink / raw
To: gentoo-commits
commit: 26c350c3b214c3b5f20f4caba6c9c58b5b67a42c
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 5 15:53:39 2015 +0000
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 5 15:53:39 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26c350c3
media-plugins/frei0r-plugins: remove stray patches
Package-Manager: portage-2.2.24
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>
.../files/frei0r-plugins-1.1.22-libdir.patch | 24 -----------
.../frei0r-plugins-1.1.22-no-automagic-deps.patch | 47 ---------------------
.../frei0r-plugins-1.1.22-pkgconfig-support.patch | 49 ----------------------
3 files changed, 120 deletions(-)
diff --git a/media-plugins/frei0r-plugins/files/frei0r-plugins-1.1.22-libdir.patch b/media-plugins/frei0r-plugins/files/frei0r-plugins-1.1.22-libdir.patch
deleted file mode 100644
index 70d2032..0000000
--- a/media-plugins/frei0r-plugins/files/frei0r-plugins-1.1.22-libdir.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -up frei0r-plugins-1.1.21/src/Makefile.am.libdir frei0r-plugins-1.1.21/src/Makefile.am
---- frei0r-plugins-1.1.21/src/Makefile.am.libdir 2008-06-07 15:21:48.000000000 +0200
-+++ frei0r-plugins-1.1.21/src/Makefile.am 2008-06-07 15:23:30.000000000 +0200
-@@ -112,7 +112,7 @@ AM_CPPFLAGS = -I@top_srcdir@/include
- AM_CFLAGS = -I@top_srcdir@/include
- AM_LDFLAGS = -module -avoid-version -Wc,-nostartfiles
-
--plugindir = @prefix@/lib/frei0r-1
-+plugindir = @libdir@/frei0r-1
-
-
- install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES)
-diff -up frei0r-plugins-1.1.21/src/Makefile.in.libdir frei0r-plugins-1.1.21/src/Makefile.in
---- frei0r-plugins-1.1.21/src/Makefile.in.libdir 2008-06-07 15:21:44.000000000 +0200
-+++ frei0r-plugins-1.1.21/src/Makefile.in 2008-06-07 15:23:08.000000000 +0200
-@@ -583,7 +583,7 @@ RGB_la_SOURCES = mixer3/RGB/RGB.c
- AM_CPPFLAGS = -I@top_srcdir@/include
- AM_CFLAGS = -I@top_srcdir@/include
- AM_LDFLAGS = -module -avoid-version -Wc,-nostartfiles
--plugindir = @prefix@/lib/frei0r-1
-+plugindir = @libdir@/frei0r-1
- all: all-am
-
- .SUFFIXES:
diff --git a/media-plugins/frei0r-plugins/files/frei0r-plugins-1.1.22-no-automagic-deps.patch b/media-plugins/frei0r-plugins/files/frei0r-plugins-1.1.22-no-automagic-deps.patch
deleted file mode 100644
index 142a9a8..0000000
--- a/media-plugins/frei0r-plugins/files/frei0r-plugins-1.1.22-no-automagic-deps.patch
+++ /dev/null
@@ -1,47 +0,0 @@
---- orig/configure.ac 2008-10-28 11:57:18.000000000 +0100
-+++ patched/configure.ac 2009-07-05 15:19:37.000000000 +0200
-@@ -11,12 +11,18 @@
- AC_PROG_CC
- AC_PROG_LIBTOOL
-
-+
-+AC_ARG_ENABLE([facedetect], [ --enable-facedetect enable facedetect plugin (needs opencv)],
-+ [facedetect=${enableval}], [facedetect=no])
-+
- HAVE_OPENCV=false
--PKG_CHECK_MODULES(OPENCV, opencv >= 1.0.0, [HAVE_OPENCV=true], [true])
--if test x$HAVE_OPENCV = xfalse; then
-- AC_MSG_WARN([*** opencv >= 1.0.0 not found - this program enables optional plugin with the Open Source Computer Vision library >= 1.0.0 http://opencvlibrary.sourceforge.net/ ***])
--else
-- OPENCV_CFLAGS="$OPENCV_CFLAGS -DOPENCV_PREFIX=`pkg-config opencv --variable=prefix`"
-+if test "x${facedetect}" = xyes; then
-+ PKG_CHECK_MODULES(OPENCV, opencv >= 1.0.0, [HAVE_OPENCV=true], [true])
-+ if test x$HAVE_OPENCV = xfalse; then
-+ AC_MSG_WARN([*** opencv >= 1.0.0 not found - this program enables optional plugin with the Open Source Computer Vision library >= 1.0.0 http://opencvlibrary.sourceforge.net/ ***])
-+ else
-+ OPENCV_CFLAGS="$OPENCV_CFLAGS -DOPENCV_PREFIX=`pkg-config opencv --variable=prefix`"
-+ fi
- fi
- AM_CONDITIONAL([HAVE_OPENCV], [test x$HAVE_OPENCV = xtrue])
-
-@@ -35,11 +41,16 @@
- AC_FUNC_MALLOC
- AC_CHECK_FUNCS([floor memset pow sqrt])
-
-+
-+AC_ARG_ENABLE([scale0tilt], [ --enable-scale0tilt enable scale0tilt plugin (needs gavl)],
-+ [scale0tilt=${enableval}], [scale0tilt=no])
-+
- HAVE_GAVL=false
--PKG_CHECK_MODULES(GAVL, gavl >= 0.2.3, [HAVE_GAVL=true], [true])
--if test x$HAVE_GAVL = xfalse; then
-- AC_MSG_WARN([*** gavl >= 0.2.3 not found - this program enables optional plugin with the gmerlin audio
-- video library >= 0.2.3 http://gmerlin.sourceforge.net/ ***])
-+if test "x${scale0tilt}" = xyes; then
-+ PKG_CHECK_MODULES(GAVL, gavl >= 0.2.3, [HAVE_GAVL=true], [true])
-+ if test x$HAVE_GAVL = xfalse; then
-+ AC_MSG_WARN([*** gavl >= 0.2.3 not found - this program enables optional plugin with the gmerlin audio video library >= 0.2.3 http://gmerlin.sourceforge.net/ ***])
-+ fi
- fi
- AM_CONDITIONAL([HAVE_GAVL], [test x$HAVE_GAVL = xtrue])
-
diff --git a/media-plugins/frei0r-plugins/files/frei0r-plugins-1.1.22-pkgconfig-support.patch b/media-plugins/frei0r-plugins/files/frei0r-plugins-1.1.22-pkgconfig-support.patch
deleted file mode 100644
index a60f18f..0000000
--- a/media-plugins/frei0r-plugins/files/frei0r-plugins-1.1.22-pkgconfig-support.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From c950588f3e9188aa51e2cd3b9346bf346ad34118 Mon Sep 17 00:00:00 2001
-From: Luca Bigliardi <shammash@artha.org>
-Date: Thu, 09 Apr 2009 15:10:53 +0000
-Subject: Add pkg-config support
-
----
-diff --git a/Makefile.am b/Makefile.am
-index 8e8dbf9..511dbc0 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -10,3 +10,7 @@
-
- SUBDIRS=src include doc
- EXTRA_DIST = Doxyfile
-+
-+pkgconfigdir = $(libdir)/pkgconfig
-+pkgconfig_DATA = frei0r.pc
-+
-diff --git a/configure.ac b/configure.ac
-index ed440a9..49d65b2 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -67,6 +67,7 @@ fi
- AM_CONDITIONAL([HAVE_GAVL], [test x$HAVE_GAVL = xtrue])
-
- AC_CONFIG_FILES([
-+ frei0r.pc
- Makefile
- include/Makefile
- src/Makefile
-diff --git a/frei0r.pc.in b/frei0r.pc.in
-new file mode 100644
-index 0000000..3bd60da
---- a/dev/null
-+++ b/frei0r.pc.in
-@@ -0,0 +1,11 @@
-+prefix=@prefix@
-+exec_prefix=@exec_prefix@
-+libdir=@libdir@
-+includedir=@includedir@
-+
-+Name: frei0r
-+Description: minimalistic plugin API for video effects
-+Version: @VERSION@
-+Libs:
-+Cflags: -I${includedir}
-+
---
-cgit v0.7.2-83-g9ec5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-plugins/frei0r-plugins/files/
@ 2016-05-06 16:01 Michael Palimaka
0 siblings, 0 replies; 3+ messages in thread
From: Michael Palimaka @ 2016-05-06 16:01 UTC (permalink / raw
To: gentoo-commits
commit: 2dbcf233bb85e3785ff8748d364c24ef42b84ffd
Author: Michael Palimaka <kensington <AT> gentoo <DOT> org>
AuthorDate: Fri May 6 15:59:32 2016 +0000
Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Fri May 6 16:01:01 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2dbcf233
media-plugins/frei0r-plugins: update patch to restore opencv-2 compatibility
Patch by PhobosK <phobosk <AT> fastmail.fm>.
Gentoo-bug: 568608
Package-Manager: portage-2.2.28
.../files/frei0r-plugins-1.4-opencv3.patch | 48 ++++++++++++++--------
1 file changed, 31 insertions(+), 17 deletions(-)
diff --git a/media-plugins/frei0r-plugins/files/frei0r-plugins-1.4-opencv3.patch b/media-plugins/frei0r-plugins/files/frei0r-plugins-1.4-opencv3.patch
index 6188c98..d6d96b0 100644
--- a/media-plugins/frei0r-plugins/files/frei0r-plugins-1.4-opencv3.patch
+++ b/media-plugins/frei0r-plugins/files/frei0r-plugins-1.4-opencv3.patch
@@ -1,50 +1,64 @@
---- ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.c.opencv3 2013-02-24 14:43:22.000000000 +0100
-+++ ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.c 2015-07-08 12:44:30.987056878 +0200
-@@ -211,8 +211,8 @@ CvSeq* detect_and_draw( IplImage* img, C
+diff -ur a/frei0r-plugins-1.4/src/filter/facedetect/facedetect.c b/frei0r-plugins-1.4/src/filter/facedetect/facedetect.c
+--- a/frei0r-plugins-1.4/src/filter/facedetect/facedetect.c 2013-02-24 15:43:22.000000000 +0200
++++ b/frei0r-plugins-1.4/src/filter/facedetect/facedetect.c 2015-12-19 12:27:05.984180725 +0200
+@@ -211,8 +211,13 @@
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)),
++#if (CV_VERSION_EPOCH != 2)
+ IplImage* small_img = cvCreateImage( cvSize( cvRound ((double)img->width/scale),
+ cvRound ((double)img->height/scale)),
++#else
+ IplImage* small_img = cvCreateImage( cvSize( cvRound (img->width/scale),
+ cvRound (img->height/scale)),
++#endif
8, 1 );
int i;
---- ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp.opencv3 2013-02-24 14:43:22.000000000 +0100
-+++ ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp 2015-07-08 12:48:32.754615885 +0200
-@@ -259,11 +259,11 @@ private:
+diff -ur a/frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp b/frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp
+--- a/frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp 2013-02-24 15:43:22.000000000 +0200
++++ b/frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp 2015-12-19 12:24:00.023349871 +0200
+@@ -259,11 +259,19 @@
{
double scale = this->scale == 0? 1.0 : this->scale;
CvScalar colors[5] = {
-- {{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)}},
++#if (CV_VERSION_EPOCH != 2)
+ 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 +287,14 @@ private:
+@@ -287,14 +295,23 @@
}
case 1:
{
-- CvBox2D box = {{center.x, center.y}, {r->width / scale, (r->height / scale) * 1.2}, 90};
++#if (CV_VERSION_EPOCH != 2)
+ 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:
{
-- CvPoint pt1 = {r->x / scale, r->y / scale};
-- CvPoint pt2 = {(r->x + r->width) / scale, (r->y + r->height) / scale};
++#if (CV_VERSION_EPOCH != 2)
+ 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;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-plugins/frei0r-plugins/files/
@ 2025-09-23 16:10 Michael Mair-Keimberger
0 siblings, 0 replies; 3+ messages in thread
From: Michael Mair-Keimberger @ 2025-09-23 16:10 UTC (permalink / raw
To: gentoo-commits
commit: ac380b81f38cc261e2712b9bdba398badb7b027b
Author: Michael Mair-Keimberger <mm1ke <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 23 16:02:35 2025 +0000
Commit: Michael Mair-Keimberger <mm1ke <AT> gentoo <DOT> org>
CommitDate: Tue Sep 23 16:10:11 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac380b81
media-plugins/frei0r-plugins: remove unused patch
Signed-off-by: Michael Mair-Keimberger <mm1ke <AT> gentoo.org>
media-plugins/frei0r-plugins/files/ocv4.patch | 368 --------------------------
1 file changed, 368 deletions(-)
diff --git a/media-plugins/frei0r-plugins/files/ocv4.patch b/media-plugins/frei0r-plugins/files/ocv4.patch
deleted file mode 100644
index 74194e8174c7..000000000000
--- a/media-plugins/frei0r-plugins/files/ocv4.patch
+++ /dev/null
@@ -1,368 +0,0 @@
-Index: frei0r-plugins-1.7.0/src/filter/facebl0r/facebl0r.cpp
-===================================================================
---- frei0r-plugins-1.7.0.orig/src/filter/facebl0r/facebl0r.cpp
-+++ frei0r-plugins-1.7.0/src/filter/facebl0r/facebl0r.cpp
-@@ -19,18 +19,20 @@
- #include <stdio.h>
- #include <string.h>
- #include <opencv2/opencv.hpp>
-+#include <opencv2/core/core_c.h>
-+#include <opencv2/imgproc/imgproc_c.h>
- #include "frei0r.hpp"
- #include "frei0r_math.h"
-
- typedef struct {
-- IplImage* hsv; //input image converted to HSV
-- IplImage* hue; //hue channel of HSV image
-- IplImage* mask; //image for masking pixels
-- IplImage* prob; //face probability estimates for each pixel
-+ cv::Mat hsv; //input image converted to HSV
-+ cv::Mat hue; //hue channel of HSV image
-+ cv::Mat mask; //image for masking pixels
-+ cv::Mat prob; //face probability estimates for each pixel
-
-- CvHistogram* hist; //histogram of hue in original face image
-+ cv::Mat hist; //histogram of hue in original face image
-
-- CvRect prev_rect; //location of face in previous frame
-+ cv::Rect prev_rect; //location of face in previous frame
- CvBox2D curr_box; //current face location estimate
- } TrackedObj;
-
-@@ -47,23 +49,23 @@ public:
- private:
-
- // camshift
-- TrackedObj* create_tracked_object (IplImage* image, CvRect* face_rect);
-+ TrackedObj* create_tracked_object (cv::Mat& image, cv::Rect& face_rect);
- void destroy_tracked_object (TrackedObj* tracked_obj);
-- CvBox2D camshift_track_face (IplImage* image, TrackedObj* imgs);
-- void update_hue_image (const IplImage* image, TrackedObj* imgs);
-+ CvBox2D camshift_track_face (cv::Mat& image, TrackedObj* imgs);
-+ void update_hue_image (const cv::Mat& image, TrackedObj* imgs);
-
- //trackface
-- CvRect* detect_face (IplImage*, CvHaarClassifierCascade*, CvMemStorage*);
-+ void detect_face (const cv::Mat&, cv::CascadeClassifier*, cv::Rect& res, bool& found);
-
-
- TrackedObj* tracked_obj;
- CvBox2D face_box; //area to draw
-- CvRect* face_rect;
-+ cv::Rect face_rect;
-
- //used by capture_video_frame, so we don't have to keep creating.
-- IplImage* image;
-+ cv::Mat image;
-
-- CvHaarClassifierCascade* cascade;
-+ cv::CascadeClassifier* cascade;
- CvMemStorage* storage;
-
- // plugin parameters
-@@ -89,17 +91,17 @@ frei0r::construct<FaceBl0r> plugin("Face
- "ZioKernel, Biilly, Jilt, Jaromil, ddennedy",
- 1,1, F0R_COLOR_MODEL_PACKED32);
-
--FaceBl0r::FaceBl0r(int wdt, int hgt) {
-+FaceBl0r::FaceBl0r(int wdt, int hgt):
-+ image(wdt, hgt, CV_8UC4)
-+{
-
-- face_rect = 0;
-- image = 0;
- tracked_obj = 0;
- face_found = 0;
-
- cascade = 0;
- storage = 0;
-
-- classifier = "/usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml";
-+ classifier = "/usr/share/opencv4/haarcascades/haarcascade_frontalface_default.xml";
- register_param(classifier,
- "Classifier",
- "Full path to the XML pattern model for recognition; look in /usr/share/opencv/haarcascades");
-@@ -124,7 +126,7 @@ FaceBl0r::~FaceBl0r() {
- if(tracked_obj)
- destroy_tracked_object(tracked_obj);
-
-- if(cascade) cvReleaseHaarClassifierCascade(&cascade);
-+ if(cascade) delete cascade;
- if(storage) cvReleaseMemStorage(&storage);
-
- }
-@@ -142,7 +144,7 @@ void FaceBl0r::update(double time,
- return;
- } else old_classifier = classifier;
-
-- cascade = (CvHaarClassifierCascade*) cvLoad(classifier.c_str(), 0, 0, 0 );
-+ cascade = new cv::CascadeClassifier(classifier);
- if (!cascade) {
- fprintf(stderr, "ERROR in filter facebl0r, classifier cascade not found:\n");
- fprintf(stderr, " %s\n", classifier.c_str());
-@@ -162,10 +164,7 @@ void FaceBl0r::update(double time,
- search_scale = CLAMP(search_scale, 0.11, 1.0);
- neighbors = CLAMP(neighbors, 0.01, 1.0);
-
-- if( !image )
-- image = cvCreateImage( cvSize(width,height), IPL_DEPTH_8U, 4 );
--
-- memcpy(image->imageData, in, size * 4);
-+ memcpy(image.data, in, size * 4);
-
- /*
- no face*
-@@ -176,12 +175,15 @@ void FaceBl0r::update(double time,
- no face*
- */
- if(face_notfound>0) {
-+ bool found = false;
-
- if(face_notfound % cvRound(recheck * 1000) == 0)
-- face_rect = detect_face(image, cascade, storage);
-+ {
-+ detect_face(image, cascade, face_rect, found);
-+ }
-
- // if no face detected
-- if (!face_rect) {
-+ if (!found) {
- face_notfound++;
- } else {
- //track detected face with camshift
-@@ -211,16 +213,17 @@ void FaceBl0r::update(double time,
- }
- else {
- ////////////////////////////////////////////////////////////////////////
-- cvSetImageROI (image, tracked_obj->prev_rect);
-+ cv::Mat roi = image(tracked_obj->prev_rect);
- // cvSmooth (image, image, CV_BLUR, 22, 22, 0, 0);
-- cvSmooth (image, image, CV_BLUR, 23, 23, 0, 0);
-+ cv::blur (roi, roi, cv::Size(23,23));
- // cvSmooth (image, image, CV_GAUSSIAN, 11, 11, 0, 0);
-- cvResetImageROI (image);
- ////////////////////////////////////////////////////////////////////////
-
- //outline face ellipse
-- if (ellipse)
-- cvEllipseBox(image, face_box, CV_RGB(255,0,0), 2, CV_AA, 0);
-+ if (ellipse) {
-+ CvSize axes = cvSize(face_box.size.width*0.5, face_box.size.height*0.5);
-+ cv::ellipse(image, cvPointFrom32f(face_box.center), axes, face_box.angle, 0, 360, CV_RGB(255,0,0), 2, CV_AA, 0);
-+ }
-
- face_found++;
- if(face_found % cvRound(recheck * 1000) == 0)
-@@ -228,133 +231,121 @@ void FaceBl0r::update(double time,
- }
- }
-
-- memcpy(out, image->imageData, size * 4);
-- cvReleaseImage(&image);
-+ memcpy(out, image.data, size * 4);
- }
-
- /* Given an image and a classider, detect and return region. */
--CvRect* FaceBl0r::detect_face (IplImage* image,
-- CvHaarClassifierCascade* cascade,
-- CvMemStorage* storage) {
-+void FaceBl0r::detect_face (const cv::Mat& image,
-+ cv::CascadeClassifier* cascade,
-+ cv::Rect& res,
-+ bool& found) {
-
-- CvRect* rect = 0;
--
-- if (cascade && storage) {
-+ if (cascade) {
- //use an equalized gray image for better recognition
-- IplImage* gray = cvCreateImage(cvSize(image->width, image->height), 8, 1);
-- cvCvtColor(image, gray, CV_BGR2GRAY);
-- cvEqualizeHist(gray, gray);
-- cvClearMemStorage(storage);
-+ //IplImage* gray = cvCreateImage(cvSize(image->width, image->height), 8, 1);
-+ cv::Mat gray;
-+ cv::cvtColor(image, gray, cv::COLOR_BGR2GRAY);
-+ cv::equalizeHist(gray, gray);
-
- //get a sequence of faces in image
- int min = cvRound(smallest * 1000);
-- CvSeq *faces = cvHaarDetectObjects(gray, cascade, storage,
-+ std::vector< cv::Rect > objects;
-+ std::vector< int > numDetections;
-+ cascade->detectMultiScale(gray, objects, numDetections,
- search_scale * 10.0,
- cvRound(neighbors * 100),
-- CV_HAAR_FIND_BIGGEST_OBJECT|//since we track only the first, get the biggest
-- CV_HAAR_DO_CANNY_PRUNING, //skip regions unlikely to contain a face
-+ cv::CASCADE_FIND_BIGGEST_OBJECT|//since we track only the first, get the biggest
-+ cv::CASCADE_DO_CANNY_PRUNING, //skip regions unlikely to contain a face
- cvSize(min, min));
-
- //if one or more faces are detected, return the first one
-- if(faces && faces->total)
-- rect = (CvRect*) cvGetSeqElem(faces, 0);
--
-- cvReleaseImage(&gray);
-+ if(!objects.empty())
-+ {
-+ res = objects[0];
-+ found = true;
-+ }
- }
--
-- return rect;
- }
-
- /* Create a camshift tracked object from a region in image. */
--TrackedObj* FaceBl0r::create_tracked_object (IplImage* image, CvRect* region) {
-+TrackedObj* FaceBl0r::create_tracked_object (cv::Mat& image, cv::Rect& region) {
- TrackedObj* obj;
-
-+ int hist_bins = 30; //number of histogram bins
-+ float hist_range[] = {0,180}; //histogram range
-+ const float* range = hist_range;
-+ const int channels[] = {0, 1, 2};
-+
- //allocate memory for tracked object struct
-- if((obj = (TrackedObj *) malloc(sizeof *obj)) != NULL) {
-+ if((obj = new TrackedObj()) != NULL) {
- //create-image: size(w,h), bit depth, channels
-- obj->hsv = cvCreateImage(cvGetSize(image), 8, 3);
-- obj->mask = cvCreateImage(cvGetSize(image), 8, 1);
-- obj->hue = cvCreateImage(cvGetSize(image), 8, 1);
-- obj->prob = cvCreateImage(cvGetSize(image), 8, 1);
--
-- int hist_bins = 30; //number of histogram bins
-- float hist_range[] = {0,180}; //histogram range
-- float* range = hist_range;
-- obj->hist = cvCreateHist(1, //number of hist dimensions
-- &hist_bins, //array of dimension sizes
-- CV_HIST_ARRAY, //representation format
-- &range, //array of ranges for bins
-- 1); //uniformity flag
-+ obj->hsv.create(image.size(), CV_8UC3);
-+ obj->mask.create(image.size(), CV_8UC1);
-+ obj->hue.create(image.size(), CV_8UC1);
-+ obj->prob.create(image.size(), CV_8UC1);
- }
-
- //create a new hue image
- update_hue_image(image, obj);
-
-- float max_val = 0.f;
-+ double max_val = 0.f;
-+ double min_val = 0.f;
-
- //create a histogram representation for the face
-- cvSetImageROI(obj->hue, *region);
-- cvSetImageROI(obj->mask, *region);
-- cvCalcHist(&obj->hue, obj->hist, 0, obj->mask);
-- cvGetMinMaxHistValue(obj->hist, 0, &max_val, 0, 0 );
-- cvConvertScale(obj->hist->bins, obj->hist->bins,
-- max_val ? 255.0/max_val : 0, 0);
-- cvResetImageROI(obj->hue);
-- cvResetImageROI(obj->mask);
-+ cv::Mat hueroi = obj->hue(region);
-+ cv::Mat maskroi = obj->mask(region);
-+ cv::calcHist(&obj->hue, 1, channels, obj->mask, obj->hist, 1, &hist_bins, &range);
-+ cv::minMaxIdx(obj->hist, &min_val, &max_val);
-+ obj->hist = (max_val ? 255.0/max_val : 0) * obj->hist;
-
- //store the previous face location
-- obj->prev_rect = *region;
-+ obj->prev_rect = region;
-
- return obj;
- }
-
- /* Release resources from tracked object. */
- void FaceBl0r::destroy_tracked_object (TrackedObj* obj) {
-- cvReleaseImage(&obj->hsv);
-- cvReleaseImage(&obj->hue);
-- cvReleaseImage(&obj->mask);
-- cvReleaseImage(&obj->prob);
-- cvReleaseHist(&obj->hist);
--
-- free(obj);
-+ delete obj;
- }
-
- /* Given an image and tracked object, return box position. */
--CvBox2D FaceBl0r::camshift_track_face (IplImage* image, TrackedObj* obj) {
-- CvConnectedComp components;
--
-+CvBox2D FaceBl0r::camshift_track_face (cv::Mat& image, TrackedObj* obj) {
- //create a new hue image
- update_hue_image(image, obj);
-
- //create a probability image based on the face histogram
-- cvCalcBackProject(&obj->hue, obj->prob, obj->hist);
-- cvAnd(obj->prob, obj->mask, obj->prob, 0);
-+ const int channels[] = {0, 1, 2};
-+ float hist_range[] = {0,180}; //histogram range
-+ const float* range = hist_range;
-+ cv::calcBackProject(&obj->hue, 1, channels, obj->hist, obj->prob, &range);
-+ obj->prob = obj->prob & obj->mask;
-
- //use CamShift to find the center of the new face probability
-- cvCamShift(obj->prob, obj->prev_rect,
-- cvTermCriteria(CV_TERMCRIT_EPS | CV_TERMCRIT_ITER, 10, 1),
-- &components, &obj->curr_box);
-+ cv::RotatedRect rrect = cv::CamShift(obj->prob, obj->prev_rect,
-+ cv::TermCriteria(cv::TermCriteria::EPS | cv::TermCriteria::MAX_ITER, 10, 1));
-
- //update face location and angle
-- obj->prev_rect = components.rect;
-- obj->curr_box.angle = -obj->curr_box.angle;
-+ obj->prev_rect = rrect.boundingRect();
-+ obj->curr_box = cvBox2D(rrect);
-+ obj->curr_box.angle = -rrect.angle;
-
- return obj->curr_box;
- }
-
--void FaceBl0r::update_hue_image (const IplImage* image, TrackedObj* obj) {
-+void FaceBl0r::update_hue_image (const cv::Mat& image, TrackedObj* obj) {
- //limits for calculating hue
- int vmin = 65, vmax = 256, smin = 55;
-
- //convert to HSV color model
-- cvCvtColor(image, obj->hsv, CV_BGR2HSV);
-+ cv::cvtColor(image, obj->hsv, cv::COLOR_BGR2HSV);
-
- //mask out-of-range values
-- cvInRangeS(obj->hsv, //source
-- cvScalar(0, smin, MIN(vmin, vmax), 0), //lower bound
-- cvScalar(180, 256, MAX(vmin, vmax) ,0), //upper bound
-+ cv::inRange(obj->hsv, //source
-+ cv::Scalar(0, smin, MIN(vmin, vmax), 0), //lower bound
-+ cv::Scalar(180, 256, MAX(vmin, vmax) ,0), //upper bound
- obj->mask); //destination
-
- //extract the hue channel, split: src, dest channels
-- cvSplit(obj->hsv, obj->hue, 0, 0, 0 );
-+ cv::split(obj->hsv, obj->hue);
- }
-Index: frei0r-plugins-1.7.0/src/filter/facedetect/facedetect.cpp
-===================================================================
---- frei0r-plugins-1.7.0.orig/src/filter/facedetect/facedetect.cpp
-+++ frei0r-plugins-1.7.0/src/filter/facedetect/facedetect.cpp
-@@ -21,6 +21,8 @@
- #include <stdio.h>
- #include <string.h>
- #include <opencv2/opencv.hpp>
-+#include <opencv2/core/core_c.h>
-+#include <opencv2/imgproc/imgproc_c.h>
- #include "frei0r.hpp"
- #include "frei0r_math.h"
-
-@@ -65,7 +67,7 @@ public:
- {
- roi.width = roi.height = 0;
- roi.x = roi.y = 0;
-- classifier = "/usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml";
-+ classifier = "/usr/share/opencv4/haarcascades/haarcascade_frontalface_default.xml";
- register_param(classifier,
- "Classifier",
- "Full path to the XML pattern model for recognition; look in /usr/share/opencv/haarcascades");
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-23 16:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-05 15:55 [gentoo-commits] repo/gentoo:master commit in: media-plugins/frei0r-plugins/files/ Alexis Ballier
-- strict thread matches above, loose matches on Subject: below --
2016-05-06 16:01 Michael Palimaka
2025-09-23 16:10 Michael Mair-Keimberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox