[vlc-commits] opencv: Refresh the internal opencv_example filter to match the updated wrapper
Edward Wang
git at videolan.org
Sun Aug 12 00:57:20 CEST 2012
vlc | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Fri Aug 10 13:25:44 2012 -0400| [67f6d91e891b6530201c7c8177e21b8c36890c98] | committer: Jean-Baptiste Kempf
opencv: Refresh the internal opencv_example filter to match the updated wrapper
This also makes it work.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=67f6d91e891b6530201c7c8177e21b8c36890c98
---
modules/video_filter/opencv_example.c | 18 +++++-------------
1 file 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);
More information about the vlc-commits
mailing list