Commit graph

149 commits

Author SHA1 Message Date
Nicola Murino
3a0a4a8d70 facedetect: Add new property min-stddev
face detection will be performed only if image standard deviation is
greater that min-stddev. Default min-stddev is 0 for backward
compatibility. This property will avoid to perform face detection on
images with little changes improving cpu usage and reducing false
positives

https://bugzilla.gnome.org/show_bug.cgi?id=730510
2014-09-05 10:38:32 +03:00
Valentin PONS
03b70aecec facedetect: Use NULL to disable eyes/nose/mouth
Without printing a warning about it

https://bugzilla.gnome.org/show_bug.cgi?id=734623
2014-08-13 12:31:17 -03:00
Robert Jobbagy
bd3cefeecc faceblur: facedetect: add properties to faceblur
Makes faceblur have the same properties as facedetect. Also improves
the standard defaults and makes them the same in the 2 elements
2014-07-30 16:43:10 -03:00
Robert Jobbagy
43a4498569 faceblur: post message when profile loading fails 2014-07-30 16:43:10 -03:00
Robert Jobbagy
555d29681b facedetect: faceblur: update launch line examples
Reflect 1.0 and more useful examples
2014-07-30 16:43:10 -03:00
David Rothlisberger
f5992a6cdd opencv templatematch: Set caps to BGR order
templatematch operates on BGR data. In fact, OpenCV's IplImage always
stores color image data in BGR order -- this isn't documented at all in
the OpenCV source code, but there are hints around the web (see for
example
http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html#SECTION00041000000000000000
and http://www.comp.leeds.ac.uk/vision/opencv/iplimage.html ).

gst_templatematch_load_template loads the template (the image to find)
from disk using OpenCV's cvLoadImage, so it is stored in an IplImage in
BGR order. But in gst_templatematch_chain, no OpenCV conversion
functions are used: the imageData pointer of the IplImage for the video
frame (the image to search in) is just set to point to the raw buffer
data. Without this fix, that raw data is in RGB order, so the call to
cvMatchTemplate ends up comparing the template's Blue channel against
the frame's Red channel, producing very poor results.
2014-07-28 14:22:27 -03:00
Thiago Santos
aa5e25820b templatematch: mark pads as proxy caps
Allows negotiation to happen properly
2014-07-28 14:18:02 -03:00
William Manley
1b5483eef9 templatematch: Produce a warning message if we can't load a template image 2014-07-28 14:18:02 -03:00
William Manley
88cb33a1dc templatematch: Match rectangle grows redder with increased match certainty
This is useful for debugging your matches as it indicates how certain the
match was in addition to its position.
2014-07-28 14:18:02 -03:00
William Manley
b608767288 templatematch: Allow changing template property on the fly
Previously changing the template property resulted in an exception
thrown from cvMatchTemplate, because "dist_image" (the intermediate
match-certainty-distribution) was the wrong size (because the
template image size had changed).

Locking has also been added to allow changing the properties (e.g. the
pattern to match) while the pipeline is playing.

 * gst_element_post_message is moved outside of the lock, because it will
   call into arbitrary user code (otherwise, if that user code calls into
   gst_templatematch_set_property on this same thread it would deadlock).

 * gst_template_match_load_template: If we fail to load the new template
   we still unload the previous template, so this element becomes a no-op
   in the pipeline. The alternative would be to keep the previous template;
   I believe unloading the previous template is a better choice, because it
   is consistent with the state this element would be in if it fails to
   load the very first template at start-up.

Thanks to Will Manley for the bulk of this work; any errors are probably
mine.
2014-07-28 14:18:01 -03:00
David Rothlisberger
c77808055d templatematch: Pass video through when nothing to match against
The early return was bypassing the call to gst_pad_push. With no
filter->template (and thus no filter->cvTemplateImage) the rest of this
function is essentially a no-op (except for the call to gst_pad_push).

This (plus the previous commit) allows templatematch to be
enabled/disabled without removing it entirely from the pipeline, by
setting/unsetting the template property.
2014-07-28 14:17:28 -03:00
William Manley
056d652b92 templatematch: Remove no-op call to gst_templatematch_load_template
We have just set filter->template to NULL, so
gst_templatematch_load_template did nothing.
2014-07-28 11:26:13 -03:00
Nicola Murino
bd4ae18938 facedetect: improve enum GstFaceDetectUpdates descriptions
https://bugzilla.gnome.org/show_bug.cgi?id=730509
2014-07-22 06:39:21 -03:00
Nicola Murino
3896dd8413 facedetect: make updates on_change works as expected
https://bugzilla.gnome.org/show_bug.cgi?id=730509
2014-07-22 06:39:21 -03:00
Sebastian Dröge
0ea13d7a65 motioncells: Use no network API if not required 2014-07-11 13:25:18 +02:00
Alexey Pavlov
365d0cfb32 ext: Include winsock.h on Windows when required
https://bugzilla.gnome.org/show_bug.cgi?id=733052
2014-07-11 13:21:21 +02:00
Nicolas Dufresne
25c289f6c4 facedetect: Make cascades dir a little more portable 2014-07-04 21:13:49 -04:00
Nicolas Dufresne
09fc19b83f handdetect: Use already mapped image
No need to map again the image, it's already handled by the base class.
2014-07-04 21:13:49 -04:00
Nicolas Dufresne
efde572cec handdetect: Move size warning in set_caps so it's called once 2014-07-04 21:13:49 -04:00
Nicolas Dufresne
34e23c2e21 faceblur: Port to OpencvVideoFilter base class
This fixes issue whit black frames when special memory, like GlMemory is
in used.

https://bugzilla.gnome.org/show_bug.cgi?id=732756
2014-07-04 21:13:49 -04:00
Nicolas Dufresne
42a83d2c64 cvvideofilter: Don't try to make buffer writable
First this is handle by base transform, hence this is a no-op, and if it wasn't it
would lead to a buffer copy being leaked, and then an unreffed buffer being
pushed downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=732756
2014-07-04 21:13:11 -04:00
Nicolas Dufresne
2acdb2ecf2 cvvideofilter: Check buffer_map return value
Check the resturn value and cleanly fail if we could not mapped the buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=732756
2014-07-04 21:12:38 -04:00
Thiago Santos
f2400d7f16 faceblur: release the haar cascade 2014-06-30 11:54:41 -03:00
Sebastian Dröge
e77a93f6a8 segmentation: Release memory storage in finalize 2014-06-30 00:22:22 +02:00
Sebastian Dröge
d5e7c7bffe textoverlay: Release memory storage and resize image when caps change 2014-06-30 00:18:20 +02:00
Sebastian Dröge
2683c87863 templatematch: Release cvImages when reloading templates are changing caps 2014-06-30 00:15:38 +02:00
Sebastian Dröge
7e0503ca89 pyramidsegment: Release image when changing caps or reusing the element 2014-06-30 00:12:26 +02:00
Sebastian Dröge
e1366c29be handdetect: Release memory storage 2014-06-30 00:09:28 +02:00
Sebastian Dröge
ae1027297c faceblur: Release memory storage
And also release cvImages and memory storage when changing caps or reusing the
element.
2014-06-30 00:07:22 +02:00
Sebastian Dröge
48e95f3d6f edgedetect: Don't leak cvImages when caps are changing or the element is reused 2014-06-30 00:05:53 +02:00
Sebastian Dröge
45ac4ba663 pyramidsegment: Release memory storage when finalizing 2014-06-29 23:43:07 +02:00
Sebastian Dröge
dcccabfe22 textoverlay: Free text buffer in finalize 2014-06-29 22:30:56 +02:00
Nicola Murino
845d33098a motioncells: improve logging
https://bugzilla.gnome.org/show_bug.cgi?id=730141
2014-05-30 16:58:59 -03:00
Nicola Murino
f48358636b motioncells: make framedrop work at 30 fps too
https://bugzilla.gnome.org/show_bug.cgi?id=730141
2014-05-30 16:58:59 -03:00
Nicola Murino
b5cefffb9f motioncells: use standard macro for boolean
https://bugzilla.gnome.org/show_bug.cgi?id=730141
2014-05-30 16:58:59 -03:00
Nicola Murino
bd34e62872 motioncells: fix memleak
Check gst_buffer_map return and remember to unmap and free memory before
returning

https://bugzilla.gnome.org/show_bug.cgi?id=730133
2014-05-14 20:15:05 -03:00
Sebastian Dröge
43e73bc3e9 motioncells: Remove unused private fields 2014-02-08 19:29:33 +01:00
Sebastian Dröge
50321b1ccd segmentation: Fix integer underflow check
error: comparison of unsigned expression < 0 is
always false [-Werror,-Wtautological-compare]
2014-02-08 19:28:26 +01:00
Sebastian Dröge
e8d569f54d faceblur: set maximum feature size to 0x0
Previously faces would only be detected if they were at least 30x30 pixels
large and at most 32x32 pixels. We keep the minimum setting (maybe needs
a property as in facedetect) but disable the maximum feature size.

See https://bugzilla.gnome.org/show_bug.cgi?id=722158
2014-01-14 10:38:37 +01:00
Kipp Cannon
b33b1390cc facedetect: set maximum feature size to 0x0
This disables the "max feature size" feature. The current configuration
is totally busted: The max feature size is hard-coded to 2 pixels more
than the user-supplied min feature size which pretty much means you need
to guess the size of the person's face to within a few pixels to get the
code to find it.

https://bugzilla.gnome.org/show_bug.cgi?id=722158
2014-01-14 10:37:41 +01:00
Tim-Philipp Müller
2d29f22338 opencv: don't unref NULL caps in finalize
Fixes gst-inspect-1.0 -a and generic states unit test.
2013-09-29 23:43:23 +01:00
Nicola Murino
e481ecbf22 facedetect: new property to control bus messages updates
https://bugzilla.gnome.org/show_bug.cgi?id=655622
2013-08-23 13:12:28 +02:00
Sebastian Dröge
21ea46568b opencv: Fix indention 2013-08-23 12:01:32 +02:00
Sebastian Dröge
5e25d41b84 opencv: Port to non-deprecated GMutex/GCond API 2013-08-23 12:01:07 +02:00
Miguel Casas-Sanchez
fbb5dd38c7 opencv: Add disparity-map calculation element
https://bugzilla.gnome.org/show_bug.cgi?id=704760
2013-08-23 11:58:21 +02:00
Miguel Casas-Sanchez
7c2177b19f grabcut: Add GrabCut segmentation element
https://bugzilla.gnome.org/show_bug.cgi?id=702722
2013-07-17 11:28:28 +02:00
Tim-Philipp Müller
67e71d7931 opencv: fix CFLAGS order and add plugins base libs includes to CXXFLAGS
https://bugzilla.gnome.org/show_bug.cgi?id=702297
2013-06-18 12:47:34 +01:00
Alban Browaeys
90b51562ab opencv: fixes build by moving the c++ header to gstsegmentation.cpp
Fixes:
In file included from gstsegmentation.h:51:0,
                 from gstopencv.c:42:
/usr/include/opencv2/video/background_segm.hpp:47:16: fatal error: list:
No such file or directory
 #include <list>
                ^
compilation terminated.

https://bugzilla.gnome.org/show_bug.cgi?id=702297
2013-06-18 13:37:26 +02:00
Miguel Casas-Sanchez
c313e1d3b8 opencv: add foreground/background segmentation element
Add an element to the opencv plugin for foregroung/background image
sequence segmentation, using one out of 3 algorithms.

https://bugzilla.gnome.org/show_bug.cgi?id=701421
2013-06-11 14:32:43 +02:00
Miguel Casas-Sanchez
407f3e1856 opencv: Add colour image enhancement element based on Retinex algorithm
Add colour image enhancement element based on Retinex algorithm. Two types
exist, namely basic and multiscale; both are described in this article:

Rahman, Zia-ur, Daniel J. Jobson, and Glenn A. Woodell. "Multi-scale retinex
for color image enhancement." Image Processing, 1996. Proceedings.,
International Conference on. Vol. 3. IEEE, 1996

Visually speaking the result looks a bit funny, but is pretty invariable to
lightning changes, which is good for some applications, like image
segmentation.

https://bugzilla.gnome.org/show_bug.cgi?id=700977
2013-05-27 11:27:20 +02:00