Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 555782 | Differences between
and this patch

Collapse All | Expand All

(-)a/frei0r-1.3/src/filter/facedetect/facedetect.c (+5 lines)
Lines 211-218 Link Here
211
211
212
  double scale = 1.3;
212
  double scale = 1.3;
213
  IplImage* gray = cvCreateImage( cvSize(img->width,img->height), 8, 1 );
213
  IplImage* gray = cvCreateImage( cvSize(img->width,img->height), 8, 1 );
214
#if (CV_VERSION_EPOCH != 2)
215
  IplImage* small_img = cvCreateImage( cvSize( cvRound ((double)img->width/scale),
216
                                               cvRound ((double)img->height/scale)),
217
#else
214
  IplImage* small_img = cvCreateImage( cvSize( cvRound (img->width/scale),
218
  IplImage* small_img = cvCreateImage( cvSize( cvRound (img->width/scale),
215
                                               cvRound (img->height/scale)),
219
                                               cvRound (img->height/scale)),
220
#endif
216
                                       8, 1 );
221
                                       8, 1 );
217
  int i;
222
  int i;
218
223
(-)a/frei0r-1.3/src/filter/facedetect/facedetect.cpp (+17 lines)
Lines 254-264 Link Here
254
    {
254
    {
255
        double scale = this->scale == 0? 1.0 : this->scale;
255
        double scale = this->scale == 0? 1.0 : this->scale;
256
        CvScalar colors[5] = {
256
        CvScalar colors[5] = {
257
#if (CV_VERSION_EPOCH != 2)
258
            CvScalar(cvRound(color[0].r * 255), cvRound(color[0].g * 255), cvRound(color[0].b * 255), cvRound(alpha * 255)),
259
            CvScalar(cvRound(color[1].r * 255), cvRound(color[1].g * 255), cvRound(color[1].b * 255), cvRound(alpha * 255)),
260
            CvScalar(cvRound(color[2].r * 255), cvRound(color[2].g * 255), cvRound(color[2].b * 255), cvRound(alpha * 255)),
261
            CvScalar(cvRound(color[3].r * 255), cvRound(color[3].g * 255), cvRound(color[3].b * 255), cvRound(alpha * 255)),
262
            CvScalar(cvRound(color[4].r * 255), cvRound(color[4].g * 255), cvRound(color[4].b * 255), cvRound(alpha * 255)),
263
#else
257
            {{cvRound(color[0].r * 255), cvRound(color[0].g * 255), cvRound(color[0].b * 255), cvRound(alpha * 255)}},
264
            {{cvRound(color[0].r * 255), cvRound(color[0].g * 255), cvRound(color[0].b * 255), cvRound(alpha * 255)}},
258
            {{cvRound(color[1].r * 255), cvRound(color[1].g * 255), cvRound(color[1].b * 255), cvRound(alpha * 255)}},
265
            {{cvRound(color[1].r * 255), cvRound(color[1].g * 255), cvRound(color[1].b * 255), cvRound(alpha * 255)}},
259
            {{cvRound(color[2].r * 255), cvRound(color[2].g * 255), cvRound(color[2].b * 255), cvRound(alpha * 255)}},
266
            {{cvRound(color[2].r * 255), cvRound(color[2].g * 255), cvRound(color[2].b * 255), cvRound(alpha * 255)}},
260
            {{cvRound(color[3].r * 255), cvRound(color[3].g * 255), cvRound(color[3].b * 255), cvRound(alpha * 255)}},
267
            {{cvRound(color[3].r * 255), cvRound(color[3].g * 255), cvRound(color[3].b * 255), cvRound(alpha * 255)}},
261
            {{cvRound(color[4].r * 255), cvRound(color[4].g * 255), cvRound(color[4].b * 255), cvRound(alpha * 255)}},
268
            {{cvRound(color[4].r * 255), cvRound(color[4].g * 255), cvRound(color[4].b * 255), cvRound(alpha * 255)}},
269
#endif
262
        };
270
        };
263
        
271
        
264
        for (int i = 0; i < (objects ? objects->total : 0); i++)
272
        for (int i = 0; i < (objects ? objects->total : 0); i++)
Lines 282-295 Link Here
282
                }
290
                }
283
            case 1:
291
            case 1:
284
                {
292
                {
293
#if (CV_VERSION_EPOCH != 2)
294
                    CvBox2D box = CvBox2D(CvPoint2D32f(center.x, center.y), CvSize2D32f(r->width / scale, (r->height / scale) * 1.2), 90);
295
#else
285
                    CvBox2D box = {{center.x, center.y}, {r->width / scale, (r->height / scale) * 1.2}, 90};
296
                    CvBox2D box = {{center.x, center.y}, {r->width / scale, (r->height / scale) * 1.2}, 90};
297
#endif
286
                    cvEllipseBox(image, box, colors[i % 5], thickness, linetype);
298
                    cvEllipseBox(image, box, colors[i % 5], thickness, linetype);
287
                    break;
299
                    break;
288
                }
300
                }
289
            case 2:
301
            case 2:
290
                {
302
                {
303
#if (CV_VERSION_EPOCH != 2)
304
                    CvPoint pt1 = CvPoint(r->x / scale, r->y / scale);
305
                    CvPoint pt2 = CvPoint((r->x + r->width) / scale, (r->y + r->height) / scale);
306
#else
291
                    CvPoint pt1 = {r->x / scale, r->y / scale};
307
                    CvPoint pt1 = {r->x / scale, r->y / scale};
292
                    CvPoint pt2 = {(r->x + r->width) / scale, (r->y + r->height) / scale};
308
                    CvPoint pt2 = {(r->x + r->width) / scale, (r->y + r->height) / scale};
309
#endif
293
                    cvRectangle(image, pt1, pt2, colors[i % 5], thickness, linetype);
310
                    cvRectangle(image, pt1, pt2, colors[i % 5], thickness, linetype);
294
                    break;
311
                    break;
295
                }
312
                }

Return to bug 555782