Advertisement
Guest User

Untitled

a guest
Jun 28th, 2015
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.69 KB | None | 0 0
  1. /*
  2.  * GStreamer
  3.  * Copyright (C) 2005 Thomas Vander Stichele <thomas@apestaart.org>
  4.  * Copyright (C) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
  5.  * Copyright (C) 2008 Michael Sheldon <mike@mikeasoft.com>
  6.  * Copyright (C) 2011 Stefan Sauer <ensonic@users.sf.net>
  7.  * Copyright (C) 2011 Robert Jobbagy <jobbagy.robert@gmail.com>
  8.  *
  9.  * Permission is hereby granted, free of charge, to any person obtaining a
  10.  * copy of this software and associated documentation files (the "Software"),
  11.  * to deal in the Software without restriction, including without limitation
  12.  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  13.  * and/or sell copies of the Software, and to permit persons to whom the
  14.  * Software is furnished to do so, subject to the following conditions:
  15.  *
  16.  * The above copyright notice and this permission notice shall be included in
  17.  * all copies or substantial portions of the Software.
  18.  *
  19.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22.  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23.  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  24.  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  25.  * DEALINGS IN THE SOFTWARE.
  26.  *
  27.  * Alternatively, the contents of this file may be used under the
  28.  * GNU Lesser General Public License Version 2.1 (the "LGPL"), in
  29.  * which case the following provisions apply instead of the ones
  30.  * mentioned above:
  31.  *
  32.  * This library is free software; you can redistribute it and/or
  33.  * modify it under the terms of the GNU Library General Public
  34.  * License as published by the Free Software Foundation; either
  35.  * version 2 of the License, or (at your option) any later version.
  36.  *
  37.  * This library is distributed in the hope that it will be useful,
  38.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  39.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  40.  * Library General Public License for more details.
  41.  *
  42.  * You should have received a copy of the GNU Library General Public
  43.  * License along with this library; if not, write to the
  44.  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  45.  * Boston, MA 02110-1301, USA.
  46.  */
  47.  
  48. #ifndef __GST_FACE_DETECT_H__
  49. #define __GST_FACE_DETECT_H__
  50.  
  51. #include <gst/gst.h>
  52. #include <cv.h>
  53. #include "gstopencvvideofilter.h"
  54.  
  55. //#if (CV_MAJOR_VERSION >= 2) && (CV_MINOR_VERSION >= 2)
  56. #include <opencv2/objdetect/objdetect.hpp>
  57. //#endif
  58.  
  59. G_BEGIN_DECLS
  60. /* #defines don't like whitespacey bits */
  61. #define GST_TYPE_FACE_DETECT \
  62.   (gst_face_detect_get_type())
  63. #define GST_FACE_DETECT(obj) \
  64.   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FACE_DETECT,GstFaceDetect))
  65. #define GST_FACE_DETECT_CLASS(klass) \
  66.   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FACE_DETECT,GstFaceDetectClass))
  67. #define GST_IS_FACE_DETECT(obj) \
  68.   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FACE_DETECT))
  69. #define GST_IS_FACE_DETECT_CLASS(klass) \
  70.   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FACE_DETECT))
  71. typedef struct _GstFaceDetect GstFaceDetect;
  72. typedef struct _GstFaceDetectClass GstFaceDetectClass;
  73.  
  74. typedef CascadeClassifier CascadeType;
  75. /**
  76.  * GstFaceDetectUpdates
  77.  * @GST_FACEDETECT_UPDATES_EVERY_FRAME: Send bus update messages for every frame
  78.  * @GST_FACEDETECT_UPDATES_ON_CHANGE: Send bus update messages on change (face detected/not detected)
  79.  * @GST_FACEDETECT_UPDATES_ON_FACE: Send bus update messages when a face is detected
  80.  * @GST_FACEDETECT_UPDATES_NONE: No bus update messages
  81.  *
  82.  * Bus messages update scheme
  83.  */
  84. enum _GstFaceDetectUpdates {
  85.   GST_FACEDETECT_UPDATES_EVERY_FRAME      = 0,
  86.   GST_FACEDETECT_UPDATES_ON_CHANGE        = 1,
  87.   GST_FACEDETECT_UPDATES_ON_FACE          = 2,
  88.   GST_FACEDETECT_UPDATES_NONE             = 3
  89. };
  90.  
  91. struct _GstFaceDetect
  92. {
  93.   GstOpencvVideoFilter element;
  94.  
  95.   gboolean display;
  96.   gboolean face_detected;
  97.  
  98.   gchar *face_profile;
  99.   gchar *nose_profile;
  100.   gchar *mouth_profile;
  101.   gchar *eyes_profile;
  102.   gdouble scale_factor;
  103.   gint min_neighbors;
  104.   gint flags;
  105.   gint min_size_width;
  106.   gint min_size_height;
  107.   gint min_stddev;
  108.   gint updates;
  109.  
  110.   IplImage *cvGray;
  111.   CvHaarClassifierCascade *cvFaceDetect;
  112.   CvHaarClassifierCascade *cvNoseDetect;
  113.   CvHaarClassifierCascade *cvMouthDetect;
  114.   CvHaarClassifierCascade *cvEyesDetect;
  115.   CvMemStorage *cvStorage;
  116. };
  117.  
  118. struct _GstFaceDetectClass
  119. {
  120.   GstOpencvVideoFilterClass parent_class;
  121. };
  122.  
  123. GType gst_face_detect_get_type (void);
  124.  
  125. gboolean gst_face_detect_plugin_init (GstPlugin * plugin);
  126.  
  127. G_END_DECLS
  128. #endif /* __GST_FACE_DETECT_H__ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement