* (performs face identification). Mostly taken from the facedetect.c
* OpenCV sample.
*****************************************************************************
* (performs face identification). Mostly taken from the facedetect.c
* OpenCV sample.
*****************************************************************************
#include "filter_event_info.h"
/*****************************************************************************
#include "filter_event_info.h"
/*****************************************************************************
- set_description( _("OpenCV face detection example filter") );
- set_shortname( _( "OpenCV example" ));
+ set_description( N_("OpenCV face detection example filter") );
+ set_shortname( N_( "OpenCV example" ));
set_capability( "opencv example", 1 );
add_shortcut( "opencv_example" );
set_capability( "opencv example", 1 );
add_shortcut( "opencv_example" );
set_category( CAT_VIDEO );
set_subcategory( SUBCAT_VIDEO_VFILTER2 );
set_callbacks( OpenFilter, CloseFilter );
add_string( "opencv-haarcascade-file", "c:\\haarcascade_frontalface_alt.xml", NULL,
set_category( CAT_VIDEO );
set_subcategory( SUBCAT_VIDEO_VFILTER2 );
set_callbacks( OpenFilter, CloseFilter );
add_string( "opencv-haarcascade-file", "c:\\haarcascade_frontalface_alt.xml", NULL,
- N_("Haar cascade filename"),
- N_("Name of XML file containing Haar cascade description"), VLC_FALSE);
+ N_("Haar cascade filename"),
+ N_("Name of XML file containing Haar cascade description"), false);
- if (var_Create( p_filter->p_libvlc_global, VIDEO_FILTER_EVENT_VARIABLE, VLC_VAR_ADDRESS | VLC_VAR_DOINHERIT ) != VLC_SUCCESS)
+ if (var_Create( p_filter->p_libvlc, VIDEO_FILTER_EVENT_VARIABLE, VLC_VAR_ADDRESS | VLC_VAR_DOINHERIT ) != VLC_SUCCESS)
msg_Err( p_filter, "Could not set %s\n", VIDEO_FILTER_EVENT_VARIABLE);
//OpenCV init specific to this example
char* filename = config_GetPsz( p_filter, "opencv-haarcascade-file" );
p_filter->p_sys->p_cascade = (CvHaarClassifierCascade*)cvLoad( filename, 0, 0, 0 );
p_filter->p_sys->p_storage = cvCreateMemStorage(0);
msg_Err( p_filter, "Could not set %s\n", VIDEO_FILTER_EVENT_VARIABLE);
//OpenCV init specific to this example
char* filename = config_GetPsz( p_filter, "opencv-haarcascade-file" );
p_filter->p_sys->p_cascade = (CvHaarClassifierCascade*)cvLoad( filename, 0, 0, 0 );
p_filter->p_sys->p_storage = cvCreateMemStorage(0);
cvReleaseMemStorage( &p_filter->p_sys->p_storage );
if (NULL != p_filter->p_sys->event_info.p_region)
cvReleaseMemStorage( &p_filter->p_sys->p_storage );
if (NULL != p_filter->p_sys->event_info.p_region)
}
/****************************************************************************
* Filter: Check for faces and raises an event when one is found.
****************************************************************************
}
/****************************************************************************
* Filter: Check for faces and raises an event when one is found.
****************************************************************************
- * p_pic: A picture_t with its p_data_orig member set to an array of
- * IplImages (one image for each picture_t plane).
+ * p_pic: A picture_t with its p_data_orig member set to an array of
+ * IplImages (one image for each picture_t plane).
****************************************************************************/
static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
{
****************************************************************************/
static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
{
p_filter->p_sys->p_storage, 1.15, 5, CV_HAAR_DO_CANNY_PRUNING,
cvSize(20, 20) );
//create the video_filter_region_info_t struct
CvRect* r;
if (faces && (faces->total > 0))
{
p_filter->p_sys->p_storage, 1.15, 5, CV_HAAR_DO_CANNY_PRUNING,
cvSize(20, 20) );
//create the video_filter_region_info_t struct
CvRect* r;
if (faces && (faces->total > 0))
{
if (NULL != p_filter->p_sys->event_info.p_region)
{
free(p_filter->p_sys->event_info.p_region);
p_filter->p_sys->event_info.p_region = NULL;
if (NULL != p_filter->p_sys->event_info.p_region)
{
free(p_filter->p_sys->event_info.p_region);
p_filter->p_sys->event_info.p_region = NULL;
if( NULL == ( p_filter->p_sys->event_info.p_region =
(video_filter_region_info_t *)malloc(faces->total*sizeof(video_filter_region_info_t))))
{
if( NULL == ( p_filter->p_sys->event_info.p_region =
(video_filter_region_info_t *)malloc(faces->total*sizeof(video_filter_region_info_t))))
{
- var_Change( p_filter->p_libvlc_global, VIDEO_FILTER_EVENT_VARIABLE, VLC_VAR_TRIGGER_CALLBACKS, NULL, NULL );
+ var_Change( p_filter->p_libvlc, VIDEO_FILTER_EVENT_VARIABLE, VLC_VAR_TRIGGER_CALLBACKS, NULL, NULL );