1 |
commit: 2dbcf233bb85e3785ff8748d364c24ef42b84ffd |
2 |
Author: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri May 6 15:59:32 2016 +0000 |
4 |
Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri May 6 16:01:01 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2dbcf233 |
7 |
|
8 |
media-plugins/frei0r-plugins: update patch to restore opencv-2 compatibility |
9 |
|
10 |
Patch by PhobosK <phobosk <AT> fastmail.fm>. |
11 |
|
12 |
Gentoo-bug: 568608 |
13 |
|
14 |
Package-Manager: portage-2.2.28 |
15 |
|
16 |
.../files/frei0r-plugins-1.4-opencv3.patch | 48 ++++++++++++++-------- |
17 |
1 file changed, 31 insertions(+), 17 deletions(-) |
18 |
|
19 |
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 |
20 |
index 6188c98..d6d96b0 100644 |
21 |
--- a/media-plugins/frei0r-plugins/files/frei0r-plugins-1.4-opencv3.patch |
22 |
+++ b/media-plugins/frei0r-plugins/files/frei0r-plugins-1.4-opencv3.patch |
23 |
@@ -1,50 +1,64 @@ |
24 |
---- ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.c.opencv3 2013-02-24 14:43:22.000000000 +0100 |
25 |
-+++ ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.c 2015-07-08 12:44:30.987056878 +0200 |
26 |
-@@ -211,8 +211,8 @@ CvSeq* detect_and_draw( IplImage* img, C |
27 |
+diff -ur a/frei0r-plugins-1.4/src/filter/facedetect/facedetect.c b/frei0r-plugins-1.4/src/filter/facedetect/facedetect.c |
28 |
+--- a/frei0r-plugins-1.4/src/filter/facedetect/facedetect.c 2013-02-24 15:43:22.000000000 +0200 |
29 |
++++ b/frei0r-plugins-1.4/src/filter/facedetect/facedetect.c 2015-12-19 12:27:05.984180725 +0200 |
30 |
+@@ -211,8 +211,13 @@ |
31 |
|
32 |
double scale = 1.3; |
33 |
IplImage* gray = cvCreateImage( cvSize(img->width,img->height), 8, 1 ); |
34 |
-- IplImage* small_img = cvCreateImage( cvSize( cvRound (img->width/scale), |
35 |
-- cvRound (img->height/scale)), |
36 |
++#if (CV_VERSION_EPOCH != 2) |
37 |
+ IplImage* small_img = cvCreateImage( cvSize( cvRound ((double)img->width/scale), |
38 |
+ cvRound ((double)img->height/scale)), |
39 |
++#else |
40 |
+ IplImage* small_img = cvCreateImage( cvSize( cvRound (img->width/scale), |
41 |
+ cvRound (img->height/scale)), |
42 |
++#endif |
43 |
8, 1 ); |
44 |
int i; |
45 |
|
46 |
---- ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp.opencv3 2013-02-24 14:43:22.000000000 +0100 |
47 |
-+++ ./frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp 2015-07-08 12:48:32.754615885 +0200 |
48 |
-@@ -259,11 +259,11 @@ private: |
49 |
+diff -ur a/frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp b/frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp |
50 |
+--- a/frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp 2013-02-24 15:43:22.000000000 +0200 |
51 |
++++ b/frei0r-plugins-1.4/src/filter/facedetect/facedetect.cpp 2015-12-19 12:24:00.023349871 +0200 |
52 |
+@@ -259,11 +259,19 @@ |
53 |
{ |
54 |
double scale = this->scale == 0? 1.0 : this->scale; |
55 |
CvScalar colors[5] = { |
56 |
-- {{cvRound(color[0].r * 255), cvRound(color[0].g * 255), cvRound(color[0].b * 255), cvRound(alpha * 255)}}, |
57 |
-- {{cvRound(color[1].r * 255), cvRound(color[1].g * 255), cvRound(color[1].b * 255), cvRound(alpha * 255)}}, |
58 |
-- {{cvRound(color[2].r * 255), cvRound(color[2].g * 255), cvRound(color[2].b * 255), cvRound(alpha * 255)}}, |
59 |
-- {{cvRound(color[3].r * 255), cvRound(color[3].g * 255), cvRound(color[3].b * 255), cvRound(alpha * 255)}}, |
60 |
-- {{cvRound(color[4].r * 255), cvRound(color[4].g * 255), cvRound(color[4].b * 255), cvRound(alpha * 255)}}, |
61 |
++#if (CV_VERSION_EPOCH != 2) |
62 |
+ CvScalar(cvRound(color[0].r * 255), cvRound(color[0].g * 255), cvRound(color[0].b * 255), cvRound(alpha * 255)), |
63 |
+ CvScalar(cvRound(color[1].r * 255), cvRound(color[1].g * 255), cvRound(color[1].b * 255), cvRound(alpha * 255)), |
64 |
+ CvScalar(cvRound(color[2].r * 255), cvRound(color[2].g * 255), cvRound(color[2].b * 255), cvRound(alpha * 255)), |
65 |
+ CvScalar(cvRound(color[3].r * 255), cvRound(color[3].g * 255), cvRound(color[3].b * 255), cvRound(alpha * 255)), |
66 |
+ CvScalar(cvRound(color[4].r * 255), cvRound(color[4].g * 255), cvRound(color[4].b * 255), cvRound(alpha * 255)), |
67 |
++#else |
68 |
+ {{cvRound(color[0].r * 255), cvRound(color[0].g * 255), cvRound(color[0].b * 255), cvRound(alpha * 255)}}, |
69 |
+ {{cvRound(color[1].r * 255), cvRound(color[1].g * 255), cvRound(color[1].b * 255), cvRound(alpha * 255)}}, |
70 |
+ {{cvRound(color[2].r * 255), cvRound(color[2].g * 255), cvRound(color[2].b * 255), cvRound(alpha * 255)}}, |
71 |
+ {{cvRound(color[3].r * 255), cvRound(color[3].g * 255), cvRound(color[3].b * 255), cvRound(alpha * 255)}}, |
72 |
+ {{cvRound(color[4].r * 255), cvRound(color[4].g * 255), cvRound(color[4].b * 255), cvRound(alpha * 255)}}, |
73 |
++#endif |
74 |
}; |
75 |
|
76 |
for (int i = 0; i < (objects ? objects->total : 0); i++) |
77 |
-@@ -287,14 +287,14 @@ private: |
78 |
+@@ -287,14 +295,23 @@ |
79 |
} |
80 |
case 1: |
81 |
{ |
82 |
-- CvBox2D box = {{center.x, center.y}, {r->width / scale, (r->height / scale) * 1.2}, 90}; |
83 |
++#if (CV_VERSION_EPOCH != 2) |
84 |
+ CvBox2D box = CvBox2D(CvPoint2D32f(center.x, center.y), CvSize2D32f(r->width / scale, (r->height / scale) * 1.2), 90); |
85 |
++#else |
86 |
+ CvBox2D box = {{center.x, center.y}, {r->width / scale, (r->height / scale) * 1.2}, 90}; |
87 |
++#endif |
88 |
cvEllipseBox(image, box, colors[i % 5], thickness, linetype); |
89 |
break; |
90 |
} |
91 |
case 2: |
92 |
{ |
93 |
-- CvPoint pt1 = {r->x / scale, r->y / scale}; |
94 |
-- CvPoint pt2 = {(r->x + r->width) / scale, (r->y + r->height) / scale}; |
95 |
++#if (CV_VERSION_EPOCH != 2) |
96 |
+ CvPoint pt1 = CvPoint(r->x / scale, r->y / scale); |
97 |
+ CvPoint pt2 = CvPoint((r->x + r->width) / scale, (r->y + r->height) / scale); |
98 |
++#else |
99 |
+ CvPoint pt1 = {r->x / scale, r->y / scale}; |
100 |
+ CvPoint pt2 = {(r->x + r->width) / scale, (r->y + r->height) / scale}; |
101 |
++#endif |
102 |
cvRectangle(image, pt1, pt2, colors[i % 5], thickness, linetype); |
103 |
break; |
104 |
} |