Commit 67f6d91e authored by Edward Wang's avatar Edward Wang Committed by Jean-Baptiste Kempf

opencv: Refresh the internal opencv_example filter to match the updated wrapper

This also makes it work.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 45148875
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
* (performs face identification). Mostly taken from the facedetect.c * (performs face identification). Mostly taken from the facedetect.c
* OpenCV sample. * OpenCV sample.
***************************************************************************** *****************************************************************************
* Copyright (C) 2006 the VideoLAN team * Copyright (C) 2006-2012 the VideoLAN team
* Copyright (C) 2012 Edward Wang
* *
* Authors: Dugal Harris <dugalh@protoclea.co.za> * Authors: Dugal Harris <dugalh@protoclea.co.za>
* Edward Wang <edward.c.wang@compdigitec.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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 * ); ...@@ -65,7 +67,7 @@ static picture_t *Filter( filter_t *, picture_t * );
vlc_module_begin () vlc_module_begin ()
set_description( N_("OpenCV face detection example filter") ) set_description( N_("OpenCV face detection example filter") )
set_shortname( N_( "OpenCV example" )) set_shortname( N_( "OpenCV example" ))
set_capability( "opencv example", 1 ) set_capability( "opencv internal filter", 1 )
add_shortcut( "opencv_example" ) add_shortcut( "opencv_example" )
set_category( CAT_VIDEO ) set_category( CAT_VIDEO )
...@@ -154,7 +156,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) ...@@ -154,7 +156,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
return NULL; return NULL;
} }
//(hack) cast the picture_t to array of IplImage* //(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; i_planes = p_pic->i_planes;
//check the image array for validity //check the image array for validity
...@@ -163,16 +165,6 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) ...@@ -163,16 +165,6 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
msg_Err( p_filter, "no image" ); msg_Err( p_filter, "no image" );
return NULL; 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 //perform face detection
cvClearMemStorage(p_sys->p_storage); cvClearMemStorage(p_sys->p_storage);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment