diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> | 2014-07-04 20:39:49 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> | 2014-07-04 21:13:49 -0400 |
commit | efde572cec7fc3f3e59889ed0cc6df2eafa00b79 (patch) | |
tree | c5361da6551c3f0c87be4338999f182fbc8305ae | |
parent | 34e23c2e2168a8b4fd84eba2fd2d8900aaf368da (diff) |
handdetect: Move size warning in set_caps so it's called once
-rw-r--r-- | ext/opencv/gsthanddetect.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/opencv/gsthanddetect.c b/ext/opencv/gsthanddetect.c index 1127296da5..f112e070fc 100644 --- a/ext/opencv/gsthanddetect.c +++ b/ext/opencv/gsthanddetect.c @@ -359,6 +359,11 @@ gst_handdetect_set_caps (GstOpencvVideoFilter * transform, GstHanddetect *filter; filter = GST_HANDDETECT (transform); + /* 320 x 240 is with the best detect accuracy, if not, give info */ + if (in_width != 320 || in_height != 240) + GST_WARNING_OBJECT (filter, + "resize to 320 x 240 to have best detect accuracy.\n"); + if (filter->cvGray) cvReleaseImage (&filter->cvGray); filter->cvGray = @@ -398,10 +403,6 @@ gst_handdetect_transform_ip (GstOpencvVideoFilter * transform, gst_buffer_map (buffer, &info, GST_MAP_READWRITE); filter->cvImage->imageData = (char *) info.data; - /* 320 x 240 is with the best detect accuracy, if not, give info */ - if (filter->cvImage->width != 320 || filter->cvImage->height != 240) - GST_INFO_OBJECT (filter, - "WARNING: resize to 320 x 240 to have best detect accuracy.\n"); /* cvt to gray colour space for hand detect */ cvCvtColor (filter->cvImage, filter->cvGray, CV_RGB2GRAY); cvClearMemStorage (filter->cvStorage); |