[gentoo-commits] repo/gentoo:master commit in: media-plugins/frei0r-plugins/, media-plugins/frei0r-plugins/files/
commit: 4ffeaa17f9e4e4507ac3b216acf436eddebe8ea7 Author: Alexis Ballier gentoo org> AuthorDate: Thu Oct 22 16:42:03 2020 + Commit: Alexis Ballier gentoo org> CommitDate: Thu Oct 22 17:02:25 2020 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ffeaa17 media-plugins/frei0r-plugins: bump to 1.7.0 fix buidl with ocv4 add multilib Package-Manager: Portage-3.0.8, Repoman-3.0.2 Signed-off-by: Alexis Ballier gentoo.org> media-plugins/frei0r-plugins/Manifest | 1 + media-plugins/frei0r-plugins/files/ocv4.patch | 368 + .../frei0r-plugins/frei0r-plugins-1.7.0.ebuild | 63 3 files changed, 432 insertions(+) diff --git a/media-plugins/frei0r-plugins/Manifest b/media-plugins/frei0r-plugins/Manifest index c172fc28be6..09f3285d7d1 100644 --- a/media-plugins/frei0r-plugins/Manifest +++ b/media-plugins/frei0r-plugins/Manifest @@ -1 +1,2 @@ DIST frei0r-plugins-1.6.1.tar.gz 1103969 BLAKE2B febcfc0a5918834e38c2aad2016c0b72f3fed731732e482ae8f9564bb5c2e0825ce050149f6728a8263d6caef11810b33ee3edfb697b0f8a212ae996e0085f45 SHA512 843790389e6de83817d1c3744a91d3365864bb0c22cf6598707ccba5ec8933f6209434011cde1303e16edd89f6cde2f22aa1fb6eca3548d892a2c77332c44aac +DIST frei0r-plugins-1.7.0.tar.gz 1214323 BLAKE2B 1b571361ced6dfc29c5b487ee78664995aab615b89ac9a0839254c5fc17ddc7147cf9eb7c2d6df33f518fa96b9761a185dba420037e6c9cdf7d0e70416aab76c SHA512 8c80e8e0ce8c302e633ea1f6ff4e2a141fd7a8bcb7fce25dc7f1f6521be11258a3efa1074c224c7323e6a17bc405413385be193a5c787e2f276252b50477ebce diff --git a/media-plugins/frei0r-plugins/files/ocv4.patch b/media-plugins/frei0r-plugins/files/ocv4.patch new file mode 100644 index 000..74194e8174c --- /dev/null +++ b/media-plugins/frei0r-plugins/files/ocv4.patch @@ -0,0 +1,368 @@ +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 + #include + #include ++#include ++#include + #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 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) +
[gentoo-commits] repo/gentoo:master commit in: media-plugins/frei0r-plugins/, media-plugins/frei0r-plugins/files/
commit: 296866130232bd0aeed4bc8e5b8dc7efd2db4069 Author: Alexis Ballier gentoo org> AuthorDate: Thu Nov 5 15:55:30 2015 + Commit: Alexis Ballier gentoo org> CommitDate: Thu Nov 5 15:55:30 2015 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29686613 media-plugins/frei0r-plugins: Fix build with opencv3. Patch from from Jozef Mlich ported by Alex Barker. Bug #555782. Package-Manager: portage-2.2.24 Signed-off-by: Alexis Ballier gentoo.org> .../files/frei0r-plugins-1.4-opencv3.patch | 50 ++ .../frei0r-plugins/frei0r-plugins-1.4.ebuild | 3 ++ 2 files changed, 53 insertions(+) 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 new file mode 100644 index 000..6188c98 --- /dev/null +++ b/media-plugins/frei0r-plugins/files/frei0r-plugins-1.4-opencv3.patch @@ -0,0 +1,50 @@ +--- ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.c.opencv3 2013-02-24 14:43:22.0 +0100 ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.c2015-07-08 12:44:30.987056878 +0200 +@@ -211,8 +211,8 @@ CvSeq* detect_and_draw( IplImage* img, C + + 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)), ++ IplImage* small_img = cvCreateImage( cvSize( cvRound ((double)img->width/scale), ++ cvRound ((double)img->height/scale)), +8, 1 ); + int i; + +--- ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp.opencv3 2013-02-24 14:43:22.0 +0100 ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp 2015-07-08 12:48:32.754615885 +0200 +@@ -259,11 +259,11 @@ private: + { + 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)}}, ++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)), + }; + + for (int i = 0; i < (objects ? objects->total : 0); i++) +@@ -287,14 +287,14 @@ private: + } + case 1: + { +-CvBox2D box = {{center.x, center.y}, {r->width / scale, (r->height / scale) * 1.2}, 90}; ++CvBox2D box = CvBox2D(CvPoint2D32f(center.x, center.y), CvSize2D32f(r->width / scale, (r->height / scale) * 1.2), 90); + 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}; ++CvPoint pt1 = CvPoint(r->x / scale, r->y / scale); ++CvPoint pt2 = CvPoint((r->x + r->width) / scale, (r->y + r->height) / scale); + cvRectangle(image, pt1, pt2, colors[i % 5], thickness, linetype); + break; + } diff --git a/media-plugins/frei0r-plugins/frei0r-plugins-1.4.ebuild b/media-plugins/frei0r-plugins/frei0r-plugins-1.4.ebuild index 1ed8d39..93a9bee 100644 --- a/media-plugins/frei0r-plugins/frei0r-plugins-1.4.ebuild +++ b/media-plugins/frei0r-plugins/frei0r-plugins-1.4.ebuild @@ -31,6 +31,9 @@ src_prepare() { -e "/LIBDIR.*frei0r-1/s:lib:$(get_libdir):" \ ${f} || die + # https://bugs.gentoo.org/show_bug.cgi?id=555782 + epatch "${FILESDIR}/${P}-opencv3.patch" + # https://bugs.gentoo.org/418243 sed -i \