mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
Make face detect send a bus message when a face is detected
Write a simple python example for face detection
This commit is contained in:
parent
7408e5393e
commit
aae2576679
1 changed files with 10 additions and 1 deletions
|
@ -269,7 +269,16 @@ gst_facedetect_chain (GstPad * pad, GstBuffer * buf)
|
|||
|
||||
for (i = 0; i < (faces ? faces->total : 0); i++) {
|
||||
CvRect* r = (CvRect *) cvGetSeqElem(faces, i);
|
||||
|
||||
|
||||
GstStructure *s = gst_structure_new ("face",
|
||||
"x", G_TYPE_UINT, r->x,
|
||||
"y", G_TYPE_UINT, r->y,
|
||||
"width", G_TYPE_UINT, r->width,
|
||||
"height", G_TYPE_UINT, r->height, NULL);
|
||||
|
||||
GstMessage *m = gst_message_new_element (GST_OBJECT (filter), s);
|
||||
gst_element_post_message (GST_ELEMENT (filter), m);
|
||||
|
||||
if (filter->display) {
|
||||
CvPoint center;
|
||||
int radius;
|
||||
|
|
Loading…
Reference in a new issue