Commit graph

202 commits

Author SHA1 Message Date
Vanessa Chipirrás Navalón
f8e11fe656 cvdilate: Change gstcvdilate to C++
Change the gstcvdilate.c file extension to cpp and add it into Makefile for
consistency with other elements of opencv and because Opencv not support C
language in new API 2.4.11.

https://bugzilla.gnome.org/show_bug.cgi?id=754148
2015-10-02 19:07:17 +01:00
Vanessa Chipirrás Navalón
7f9aef31cb skindetect: Change gstskindetect to C++
Change the file extension to cpp and add it into Makefile for consistency
with other elements of opencv and because Opencv not support C language in
new API 2.4.11.

https://bugzilla.gnome.org/show_bug.cgi?id=754148
2015-10-02 18:58:49 +01:00
Vanessa Chipirrás Navalón
1c9763c0eb opencvutils: add extern C, for the opencv elements work.
Adding G_BEGIN_DECLS and G_END_DECLS to gstopencvutils.h
to allow C-style linking.

https://bugzilla.gnome.org/show_bug.cgi?id=754148
2015-10-02 18:46:38 +01:00
Luis de Bethencourt
e2709ed2ef retinex: use OpenCV namespace
As part of the switch to C++, use the new OpenCV functions.

https://bugzilla.gnome.org/show_bug.cgi?id=754148
2015-10-02 18:41:45 +01:00
Vanessa Chipirrás Navalón
ae55a537e6 cvsmooth: port to C++
Change the file extension to cpp and add it into Makefile for consistency
with other elements of opencv and because Opencv not support C language in
new API 2.4.11.

https://bugzilla.gnome.org/show_bug.cgi?id=754148
2015-10-02 18:41:27 +01:00
Vanessa Chipirrás Navalón
936665dfd6 retinex: Change retinex to C++
Change the gstretinex.c file to cpp and add it into Makefile.
It is necessary to migrate the retinex element to C++,
because new Opencv API leaves obsolete functions like cvSmooth.
This element uses this function.

You can see in this link:
http://docs.opencv.org/modules/imgproc/doc/filtering.html?
highlight=cvsmooth#void cvSmooth(const CvArr* src, CvArr* dst,
int smoothtype, int size1, int size2, double sigma1, double sigma2)

https://bugzilla.gnome.org/show_bug.cgi?id=754148
2015-10-02 18:07:06 +01:00
Vanessa Chipirrás Navalón
31b1938a5f handdetect: remove another unused variable
Memory is reserved for this variable and then released without making any
use of it.

https://bugzilla.gnome.org/show_bug.cgi?id=752528
2015-10-02 17:19:12 +01:00
Luis de Bethencourt
e00461a789 handdetect: CvPoint values changed from uint to int
The x and y values of CvPoint changed from unsigned to signed integers
in OpenCV 2.4.11.

https://bugzilla.gnome.org/show_bug.cgi?id=752528
2015-10-02 17:10:59 +01:00
Luis de Bethencourt
75e38f915f handdetect: need to migrate to C++
The cascade classifier changes its structure on new version of OpenCV 2.4.11.
It is need to migrate to C++ to utilize the new load method of OpenCV which
allows to load the old and new classifiers.

https://bugzilla.gnome.org/show_bug.cgi?id=752528
2015-10-02 17:10:59 +01:00
Luis de Bethencourt
dab249a445 handdetect: Change gsthanddetect to C++
Change the gsthanddetect.c file to cpp and add it into Makefile.
It is necessary to migrate the handdetect plugin to C++,
in order to load new and old classifiers, to make handdetect work
with newer versions of Opencv.

https://bugzilla.gnome.org/show_bug.cgi?id=752528
2015-10-02 17:10:59 +01:00
Luis de Bethencourt
28b2ac7e65 opencv: erode: remove non-ip transform func
Transform is set to be done in place in gstcvdilateerode.c, so the in-place
transform function is always used and the other is redundant. Removing it.

https://bugzilla.gnome.org/show_bug.cgi?id=753885
2015-09-29 20:41:52 +01:00
Luis de Bethencourt
97ee5abd49 opencv: dilate: remove non-ip transform func
Transform is set to be done in place in gstcvdilateerode.c, so the in-place
transform function is always used and the other is redundant. Removing it.

https://bugzilla.gnome.org/show_bug.cgi?id=753885
2015-09-29 20:38:14 +01:00
Luis de Bethencourt
45d9184c88 opencv: use gst_opencv_video_filter_set_in_place()
Using the gst_base_transform function directly won't work. Need to use
gst_opencv_video_filter_set_in_place().
2015-09-29 20:00:14 +01:00
Luis de Bethencourt
9bb76699e0 handdetect: check for haar cascade files path
When running GStreamer from uninstalled sources, the location of the haar
cascade files will be local. Check if running in uninstalled and set the
file paths accordingly.
2015-09-29 17:01:55 +01:00
Luis de Bethencourt
6bc00355b8 opencv: cvlaplace: add scale and shift properties
Add scale and shift properties so these can be used to tweak the values
used in cvConvertScale() instead of using only defaults.
2015-09-29 13:53:12 +01:00
Vanessa Chipirrás Navalón
1e14ceedb3 edgedetect: Rename gstedgedetect.c to gstedgedetect.cpp for consistency.
Change the file extension to cpp and add it into Makefile for consistency
with other elements of opencv.

https://bugzilla.gnome.org/show_bug.cgi?id=754148
2015-08-28 14:23:02 +01:00
Vanessa Chipirrás Navalón
d53f37cfe3 edgedetect: remove unused and useless functions.
The cvSmooth cvNot functions and do not have the correct input parameters.
Furthermore, cvSmooth function is not necessary for edge detection,
because the Canny function makes the step of smoothing the image.
And cvNot function is useless because there aren't changes if this
function is eliminated.

https://bugzilla.gnome.org/show_bug.cgi?id=754148
2015-08-28 14:20:11 +01:00
Luis de Bethencourt
a77d61edc5 textoverlay: remove unused variable
Memory is reserved for this variable but never used. Removing it.
2015-08-28 12:26:45 +01:00
Vanessa Chipirrás Navalón
ad0d035150 faceblur: remove unused variable.
Memory is reserved for this variable and then released without making any
use of it.

https://bugzilla.gnome.org/show_bug.cgi?id=753994
2015-08-28 12:26:45 +01:00
Vanessa Chipirrás Navalón
02d8a4f4e8 faceblur: need to migrate to C++.
The cascade classifier changes its structure on new version of OpenCV 2.4.11.
It is need to migrate to C++ to utilize the new load method of OpenCV which
allows to load the old and new classifiers.

https://bugzilla.gnome.org/show_bug.cgi?id=753994
2015-08-28 12:26:45 +01:00
Vanessa Chipirrás Navalón
acdcfedde2 faceblur: Check CvHaarClassifierCascade is release before being modified.
For PROP_PROFILE case that exist inside gst_face_blur_set_property
function loads the new XML file in the CvHaarClassifierCascade property
without first checking that it is released because maybe there is an XML
file previously loaded.

https://bugzilla.gnome.org/show_bug.cgi?id=753994
2015-08-28 12:26:45 +01:00
Vanessa Chipirrás Navalón
bbd16144ca faceblur: Code refactoring of gst_face_blur_load_profile.
Changes inside the gst_face_blur_load_profile function, the number of
input parameters and in lines where it is used due to it cannot be used
generically.

https://bugzilla.gnome.org/show_bug.cgi?id=753994
2015-08-28 12:26:45 +01:00
Vanessa Chipirrás Navalón
6193f52f2d faceblur: Change gstfaceblur to C++.
Change the gstfaceblur.c file to cpp and add it into Makefile.
It is necessary to migrate the faceblur plugin to C++,
in order to load new and old classifiers, to make faceblur work
with newer versions of Opencv.

https://bugzilla.gnome.org/show_bug.cgi?id=753994
2015-08-28 12:26:45 +01:00
Vanessa Chipirrás Navalón
aa58ff3e46 facedetect: remove unnecessary variable.
Memory is reserved for this variable and then released without making any
use of it.

https://bugzilla.gnome.org/show_bug.cgi?id=748377
2015-08-21 09:28:15 +01:00
Vanessa Chipirrás Navalón
7dd86c26b2 handdetect: remove unnecessary variable.
Memory is reserved for this variable and then released without making any
use of it.

https://bugzilla.gnome.org/show_bug.cgi?id=752528
2015-08-18 13:52:10 +01:00
Vanessa Chipirrás Navalón
fc03a17430 handdetect: check CvHaarClassifierCascade is release before being modified.
Make sure a previous cascade, if it exists, is released before loading a
new XML file onto it.

https://bugzilla.gnome.org/show_bug.cgi?id=752528
2015-08-18 13:32:54 +01:00
Vanessa Chipirrás Navalón
00a55d1a69 handdetect: code refactoring of gst_handdetect_load_profile.
Change gst_handdetect_load_profile() so it can be used generically.

https://bugzilla.gnome.org/show_bug.cgi?id=752528
2015-08-18 12:24:21 +01:00
Luis de Bethencourt
07ee52db5d opencv: support alternative path convention
Some distributions store OpenCV files in /usr/share/opencv and some others
(and default when building from source) install them in
/usr/share/OpenCV. Support both to find cascade files.

https://bugzilla.gnome.org/show_bug.cgi?id=753651
2015-08-17 18:05:50 +01:00
Vanessa Chipirrás Navalón
7a2f5d6b03 facedetect: Refactor the code
Some lines of code are repeated several times, therefore
this lines are simplified with a inline function, that this is
proper style of C++.
2015-08-14 18:28:43 +01:00
Vanessa Chipi
32942c99d8 facedetect: wrong form to write the delete operator
The delete operator is written this way: delete (cascade). This way is
misspelled, it is an operator, not a function. Delete the parentheses.
2015-08-11 11:26:17 +01:00
vanechipi
28f9ff1312 facedetect: simplify repeated code.
Store the value of r.height / 2 instead of repeating the operation line
three times.
2015-08-11 11:18:50 +01:00
vanechipi
73bc2cf7b0 facedetect: Redundancy exists in code.
Checking the vector is not empty and checking the vector size is greater
than zero are the same thing, this is a redundancy in the code. Only
checking the vector is not empty is sufficient, therefore removing the
other check.
2015-08-11 11:13:23 +01:00
Luis de Bethencourt
3a765e0805 facedetect: fix profile loading check
Since the profile gchar depends on DEFAULT_FACE_PROFILE, it should never be
NULL. Furthermore CascadeClassifier accepts any input, even
an empty one, but if the profile fails to load it returns an empty cascade.
Check for this instead, and inform the user if there was an Error.
2015-08-07 15:51:40 +01:00
Luis de Bethencourt
316657a2f8 configure: update OpenCV requirements to 2.3.0
With facedetect ported to C++ the minimum version of OpenCV
supported is 2.3.0

https://bugzilla.gnome.org/show_bug.cgi?id=748377
2015-08-07 13:14:11 +01:00
Luis de Bethencourt
0113029fb9 opencv: facedetect: free IplImage with cvReleaseImage
Using delete() with IplImage will fail to free some of the structure's
contents. cvReleaseImage() is the proper way of freeing the memory.
2015-08-05 11:56:37 +01:00
Luis de Bethencourt
cc8af753b9 opencv: facedetect: check pointer before using it
Check if profile is NULL before dereferencing it with new. Also, new will
never return NULL; if allocation fails, a std::bad_alloc exception will be
thrown instead. Remove check for a NULL return.

CID #1315258
2015-08-05 11:39:03 +01:00
Tim-Philipp Müller
0e70f8c94f opencv: facedetect: fix crashes in finalize
Fixes gst-inspect-1.0 -a crashing.
2015-08-04 14:30:17 +01:00
Jan Schmidt
bd30d516a8 opencv: Fix 32-bit build / format strings.
Use G_GSIZE_FORMAT for format strings where relevant
2015-08-04 00:20:27 +10:00
Thiago Santos
2df67f9da0 templatematch: revert rename of property
The property doesn't need to have its name changed because of C++,
just the instance variables.
2015-08-01 11:52:12 -03:00
Luis de Bethencourt
2111f50a6f templatematch: rename conflicting variable
With the switch of gstopencv.c to C++, all OpenCV elements are built with
g++. The template variable clashes with C++'s feature of the same name.
Rename template to templ to avoid any clash.
2015-07-31 16:49:35 +01:00
Vanessa Chipirrás
78d0c5f01e facedetect: need to migrate to C++
The cascade classifier changes its structure on new version of OpenCV.
The need to migrate to C++ to utilize the new load method of OpenCV which
allows to load the new classifiers.

https://bugzilla.gnome.org/show_bug.cgi?id=748377
2015-07-31 16:49:17 +01:00
Luis de Bethencourt
bf2f4f5c8c docs: decodebin2 -> decodebin 2015-06-25 11:02:45 +01:00
Nicolas Dufresne
55a5c5f7df motioncells: Port to g_get_current_time
This is more portable.

https://bugzilla.gnome.org/show_bug.cgi?id=751221
2015-06-22 15:48:51 -04:00
Luis de Bethencourt
9c729ef678 opencv: 'for' loop initial declaration
'for' loop initial declarations are not allowed in C89, moving the declarations
to before the 'for' loops.
2015-05-27 13:10:35 +01:00
Vineeth T M
6b43d7f770 cvsmooth: rename properties
The properties are named as param1 to param4, which makes very little sense
hence renamed the properties according to what it is doing.

https://bugzilla.gnome.org/show_bug.cgi?id=749523
2015-05-18 10:50:23 +03:00
Vineeth T M
1fa8e75f44 cvsmooth: Wrong assignment of prop leads to crash
when setting param2 property, it is wrongly being assigned to param1.
This leads to wrong behavior and a crash when param2 is set as 0.

https://bugzilla.gnome.org/show_bug.cgi?id=749523
2015-05-18 10:48:49 +03:00
Vineeth T M
8df641016e pyramidsegment: wrong value of level property
The property level has a minimum value of 0. But when we set the level as 0,
it gets an assertion error. The function icvPyrSegmentation8uC3R returns false
if level is set as 0, since the minimum level cant be 0 and thus results in error.
Hence changing the minimum value to 1.

https://bugzilla.gnome.org/show_bug.cgi?id=749525
2015-05-18 10:47:45 +03:00
Edward Hervey
1ce65e2f74 handdetect: remove unneeded check
Variable hands is already checked to contain a value previously at the beginning
of the current block. There is no need to check again. This is logically dead code.

CID 1197693
2015-04-20 14:31:42 +02:00
Руслан Ижбулатов
589407a077 opencv: Change opencv plugin to use opencv2-style includes
If old opencv1-style legacy include directory is available,
this change becomes purely cosmetic (maybe will compile a bit faster).
It becomes an FTBFS fix when opencv1-style include directory is missing
(possibly because opencv package maintainer decided not to pack it).

https://bugzilla.gnome.org/show_bug.cgi?id=747705
2015-04-17 18:34:22 +02:00
Luis de Bethencourt
290508932e motioncells: protect against not found id
If searchIdx() doesn't find the id it returns -1, which breaks
motioncelssvector.at (idx). Check for it and return if not found.

Changing a few other lines for style consistency.
2015-03-05 15:56:44 +00:00