[vlc-devel] [PATCH 2/7] opencv: Refresh the internal opencv_example filter to match the updated wrapper

Edward Wang edward.c.wang at compdigitec.com
Fri Aug 10 19:25:44 CEST 2012


This also makes it work.
---
 modules/video_filter/opencv_example.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/modules/video_filter/opencv_example.c b/modules/video_filter/opencv_example.c
index b32cdcd..9d55b32 100644
--- a/modules/video_filter/opencv_example.c
+++ b/modules/video_filter/opencv_example.c
@@ -3,9 +3,11 @@
  * (performs face identification).  Mostly taken from the facedetect.c
  * OpenCV sample.
  *****************************************************************************
- * Copyright (C) 2006 the VideoLAN team
+ * Copyright (C) 2006-2012 the VideoLAN team
+ * Copyright (C) 2012 Edward Wang
  *
  * Authors: Dugal Harris <dugalh at protoclea.co.za>
+ *          Edward Wang <edward.c.wang at compdigitec.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -65,7 +67,7 @@ static picture_t *Filter( filter_t *, picture_t * );
 vlc_module_begin ()
     set_description( N_("OpenCV face detection example filter") )
     set_shortname( N_( "OpenCV example" ))
-    set_capability( "opencv example", 1 )
+    set_capability( "opencv internal filter", 1 )
     add_shortcut( "opencv_example" )
 
     set_category( CAT_VIDEO )
@@ -154,7 +156,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
         return NULL;
     }
     //(hack) cast the picture_t to array of IplImage*
-    p_img = (IplImage**) p_pic->p[0].p_pixels;
+    p_img = (IplImage**) p_pic;
     i_planes = p_pic->i_planes;
 
     //check the image array for validity
@@ -163,16 +165,6 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
         msg_Err( p_filter, "no image" );
         return NULL;
     }
-    if ((p_pic->format.i_chroma != VLC_CODEC_I420))
-    {
-        msg_Err( p_filter, "wrong chroma - use I420" );
-        return NULL;
-    }
-    if (i_planes<1)
-    {
-        msg_Err( p_filter, "no image planes" );
-        return NULL;
-    }
 
     //perform face detection
     cvClearMemStorage(p_sys->p_storage);
-- 
1.7.5.4




More information about the vlc-devel mailing list