1 |
commit: 296866130232bd0aeed4bc8e5b8dc7efd2db4069 |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Nov 5 15:55:30 2015 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Nov 5 15:55:30 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29686613 |
7 |
|
8 |
media-plugins/frei0r-plugins: Fix build with opencv3. Patch from from Jozef Mlich ported by Alex Barker. Bug #555782. |
9 |
|
10 |
Package-Manager: portage-2.2.24 |
11 |
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org> |
12 |
|
13 |
.../files/frei0r-plugins-1.4-opencv3.patch | 50 ++++++++++++++++++++++ |
14 |
.../frei0r-plugins/frei0r-plugins-1.4.ebuild | 3 ++ |
15 |
2 files changed, 53 insertions(+) |
16 |
|
17 |
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 |
18 |
new file mode 100644 |
19 |
index 0000000..6188c98 |
20 |
--- /dev/null |
21 |
+++ b/media-plugins/frei0r-plugins/files/frei0r-plugins-1.4-opencv3.patch |
22 |
@@ -0,0 +1,50 @@ |
23 |
+--- ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.c.opencv3 2013-02-24 14:43:22.000000000 +0100 |
24 |
++++ ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.c 2015-07-08 12:44:30.987056878 +0200 |
25 |
+@@ -211,8 +211,8 @@ CvSeq* detect_and_draw( IplImage* img, C |
26 |
+ |
27 |
+ double scale = 1.3; |
28 |
+ IplImage* gray = cvCreateImage( cvSize(img->width,img->height), 8, 1 ); |
29 |
+- IplImage* small_img = cvCreateImage( cvSize( cvRound (img->width/scale), |
30 |
+- cvRound (img->height/scale)), |
31 |
++ IplImage* small_img = cvCreateImage( cvSize( cvRound ((double)img->width/scale), |
32 |
++ cvRound ((double)img->height/scale)), |
33 |
+ 8, 1 ); |
34 |
+ int i; |
35 |
+ |
36 |
+--- ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp.opencv3 2013-02-24 14:43:22.000000000 +0100 |
37 |
++++ ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp 2015-07-08 12:48:32.754615885 +0200 |
38 |
+@@ -259,11 +259,11 @@ private: |
39 |
+ { |
40 |
+ double scale = this->scale == 0? 1.0 : this->scale; |
41 |
+ CvScalar colors[5] = { |
42 |
+- {{cvRound(color[0].r * 255), cvRound(color[0].g * 255), cvRound(color[0].b * 255), cvRound(alpha * 255)}}, |
43 |
+- {{cvRound(color[1].r * 255), cvRound(color[1].g * 255), cvRound(color[1].b * 255), cvRound(alpha * 255)}}, |
44 |
+- {{cvRound(color[2].r * 255), cvRound(color[2].g * 255), cvRound(color[2].b * 255), cvRound(alpha * 255)}}, |
45 |
+- {{cvRound(color[3].r * 255), cvRound(color[3].g * 255), cvRound(color[3].b * 255), cvRound(alpha * 255)}}, |
46 |
+- {{cvRound(color[4].r * 255), cvRound(color[4].g * 255), cvRound(color[4].b * 255), cvRound(alpha * 255)}}, |
47 |
++ CvScalar(cvRound(color[0].r * 255), cvRound(color[0].g * 255), cvRound(color[0].b * 255), cvRound(alpha * 255)), |
48 |
++ CvScalar(cvRound(color[1].r * 255), cvRound(color[1].g * 255), cvRound(color[1].b * 255), cvRound(alpha * 255)), |
49 |
++ CvScalar(cvRound(color[2].r * 255), cvRound(color[2].g * 255), cvRound(color[2].b * 255), cvRound(alpha * 255)), |
50 |
++ CvScalar(cvRound(color[3].r * 255), cvRound(color[3].g * 255), cvRound(color[3].b * 255), cvRound(alpha * 255)), |
51 |
++ CvScalar(cvRound(color[4].r * 255), cvRound(color[4].g * 255), cvRound(color[4].b * 255), cvRound(alpha * 255)), |
52 |
+ }; |
53 |
+ |
54 |
+ for (int i = 0; i < (objects ? objects->total : 0); i++) |
55 |
+@@ -287,14 +287,14 @@ private: |
56 |
+ } |
57 |
+ case 1: |
58 |
+ { |
59 |
+- CvBox2D box = {{center.x, center.y}, {r->width / scale, (r->height / scale) * 1.2}, 90}; |
60 |
++ CvBox2D box = CvBox2D(CvPoint2D32f(center.x, center.y), CvSize2D32f(r->width / scale, (r->height / scale) * 1.2), 90); |
61 |
+ cvEllipseBox(image, box, colors[i % 5], thickness, linetype); |
62 |
+ break; |
63 |
+ } |
64 |
+ case 2: |
65 |
+ { |
66 |
+- CvPoint pt1 = {r->x / scale, r->y / scale}; |
67 |
+- CvPoint pt2 = {(r->x + r->width) / scale, (r->y + r->height) / scale}; |
68 |
++ CvPoint pt1 = CvPoint(r->x / scale, r->y / scale); |
69 |
++ CvPoint pt2 = CvPoint((r->x + r->width) / scale, (r->y + r->height) / scale); |
70 |
+ cvRectangle(image, pt1, pt2, colors[i % 5], thickness, linetype); |
71 |
+ break; |
72 |
+ } |
73 |
|
74 |
diff --git a/media-plugins/frei0r-plugins/frei0r-plugins-1.4.ebuild b/media-plugins/frei0r-plugins/frei0r-plugins-1.4.ebuild |
75 |
index 1ed8d39..93a9bee 100644 |
76 |
--- a/media-plugins/frei0r-plugins/frei0r-plugins-1.4.ebuild |
77 |
+++ b/media-plugins/frei0r-plugins/frei0r-plugins-1.4.ebuild |
78 |
@@ -31,6 +31,9 @@ src_prepare() { |
79 |
-e "/LIBDIR.*frei0r-1/s:lib:$(get_libdir):" \ |
80 |
${f} || die |
81 |
|
82 |
+ # https://bugs.gentoo.org/show_bug.cgi?id=555782 |
83 |
+ epatch "${FILESDIR}/${P}-opencv3.patch" |
84 |
+ |
85 |
# https://bugs.gentoo.org/418243 |
86 |
sed -i \ |
87 |
-e '/set.*CMAKE_C_FLAGS/s:"): ${CMAKE_C_FLAGS}&:' \ |