Commit graph

13 commits

Author SHA1 Message Date
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
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
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
Renamed from ext/opencv/gstfacedetect.c (Browse further)