Commit graph

294 commits

Author SHA1 Message Date
Michał Górny
a8889bdcbc opencv: Support smoothing only part of the image
https://bugzilla.gnome.org/show_bug.cgi?id=788567
2017-10-16 11:07:07 +02:00
Michał Górny
798d899a25 opencv: Add 'kernel' prefix to width/height
Rename width to kernel-width, and height to kernel-height to avoid
ambiguity in the name.

https://bugzilla.gnome.org/show_bug.cgi?id=788567
2017-10-16 11:07:07 +02:00
Nicola Murino
6ef65f550b opencv: allow compilation against 3.3.0
https://bugzilla.gnome.org/show_bug.cgi?id=787234
2017-09-04 10:10:48 +03:00
Dmitry Zhadinets
f0a75cf029 motioncells: delay motionmaskcoords until caps arrive
motionmaskcoords is not applied on start because the information
about resolution isn't available until caps arrive.

https://bugzilla.gnome.org/show_bug.cgi?id=768666
2017-05-18 13:37:03 +02:00
Nicolas Dufresne
4261692187 Remove plugin specific static build option
Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.
2017-05-16 14:05:52 -04:00
Nicolas Dufresne
a7737b6dce opencv/meson: Allow 3.2.0
This was already added and tested in autoconf.
2017-05-11 09:22:54 -04:00
Nicolas Dufresne
f6929ed1ed opencv/meson: Ensure variable opencv_found is set
If the required version is not satisfied, we need to make sure this
variable is set, otherwise build will fail.
2017-05-09 15:07:51 -04:00
Nicolas Dufresne
60fa3cab5b Bump and update for meson 0.40.1
This patch bumps the required meson to 0.40.1 as gstreamer core just
did, and cleanup some code to use a feature from 0.37 that allow
specifying version range when checking dependency.

https://bugzilla.gnome.org/show_bug.cgi?id=780654
2017-05-09 13:18:45 -04:00
Jan Schmidt
b392ab4bcd motioncells: Fix cell string generation
Allow 1 extra char in the tmp buffer where the motion cell
snippets are generated, so that it doesn't leave off a comma
when dealing with cells that have 2 numerals in both indices
2017-04-14 01:58:11 +10:00
Sebastian Dröge
d520d1b3ed motioncells: Initialize m_changed_datafile class field
CID 1197704
2017-02-28 12:53:11 +02:00
Sebastian Dröge
718c4140fa dewarp: Store C++ types as pointers in C structs
Otherwise the destructor will never be called, and we would have to call
the constructors manually at some point... which we never did, so
calling release() on it before it got otherwise initialized caused a
crash. For example when running gst-inspect-1.0.
2017-02-01 13:44:37 +02:00
Nicola Murino
09835b3d27 motioncells: fix mingw build
https://bugzilla.gnome.org/show_bug.cgi?id=777930
2017-01-30 12:38:05 +02:00
Sebastian Dröge
47847a4d5d opencv: Fix build with OpenCV < 3
We only need the opencv2/bgsegm.hpp header for OpenCV >= 3 and have
compat code for older versions.
2017-01-12 16:03:27 +02:00
Garima Gaur
81b0a14d69 Fix some caps leaks in pad template creation code
gst_pad_template_new() does not take ownership of
the caps passed to it, so we need to unref the caps.

https://bugzilla.gnome.org/show_bug.cgi?id=776790
https://bugzilla.gnome.org/show_bug.cgi?id=776787
2017-01-03 10:02:58 +00:00
Nicola Murino
8f674a3639 opencv: add dewarp plugin
new plugin that dewarp fisheye images

https://bugzilla.gnome.org/show_bug.cgi?id=776047
2017-01-02 19:48:34 -05:00
Sebastian Dröge
5c99f9cf37 gst: Don't declare variables inside the for loop header
This is a C99 feature.
2016-12-13 22:39:01 +02:00
Nicolas Dufresne
fc284f7b1c segmentation: Port to GstOpencvVideoFilter base class 2016-12-04 14:49:05 -05:00
Nicolas Dufresne
2b43312a55 grabcut: Port to GstOpencvVideoFilter base class 2016-12-04 14:49:05 -05:00
Nicolas Dufresne
ee940b130f retinex: Port to GstOpencvVideoFilter base class
This allow reducing slightly the code. It also fixes a bug caused by
in-place buffer being mapped and never unmapped.
2016-12-04 14:49:05 -05:00
Nicolas Dufresne
ab28399abd opencv/meson: check presence of required opencv_contrib headers
https://bugzilla.gnome.org/show_bug.cgi?id=772822
2016-12-01 22:02:51 -05:00
Nicolas Dufresne
79b7d07162 edgedetect: Avoid extra copy of the output image
Simply produce the result into the output image provided by the base
class. This avoid useless copy. This also removes unchecked buffer map
and ensure that GstVideoMeta is respected (for stride mostly).

https://bugzilla.gnome.org/show_bug.cgi?id=775377
2016-12-01 21:56:10 -05:00
Nicolas Dufresne
63d4c89560 edgedetect: Remove redundant CAPS event handler
There is already a cv_set_caps() implemented, so just do the
entire work there.

https://bugzilla.gnome.org/show_bug.cgi?id=775377
2016-12-01 21:56:10 -05:00
Nicolas Dufresne
ff6ed239b4 cvlaplace: Avoid extra copy of the output image
Simply produce the result into the output image provided by the base
class. This avoid useless copy. This also removes unchecked buffer map
and ensure that GstVideoMeta is respected (for stride mostly).

https://bugzilla.gnome.org/show_bug.cgi?id=775377
2016-12-01 21:56:10 -05:00
Nicolas Dufresne
50e0165ea8 cvlaplace: Remove redundant CAPS event handler
There is already a cv_set_caps() implemented, so just do the
entire work there.

https://bugzilla.gnome.org/show_bug.cgi?id=775377
2016-12-01 21:56:09 -05:00
Nicolas Dufresne
02b20f6158 cvsobel: Avoid extra copy of the output image
Simply produce the result into the output image provided by the base
class. This avoid useless copy. This also removes unchecked buffer map
and ensure that GstVideoMeta is respected (for stride mostly).

https://bugzilla.gnome.org/show_bug.cgi?id=775377
2016-12-01 21:56:09 -05:00
Nicolas Dufresne
7a284f1a86 cvsobel: Remove redundant CAPS event handler
There is already a cv_set_caps() implemented, so just do the
entire work there.

https://bugzilla.gnome.org/show_bug.cgi?id=775377
2016-12-01 21:56:09 -05:00
Nicolas Dufresne
831735fc1c opencv: Remove uneeded buffer writability check
When set to in_place, the BaseTransform class will guaranty that buffers
passed to transform_ip() function are writable.

https://bugzilla.gnome.org/show_bug.cgi?id=775378
2016-12-01 21:15:28 -05:00
Nirbheek Chauhan
2160e0e2bd meson: Rework opencv plugin checks
a) Use get_pkgconfig_variable() to get the opencv prefix
b) Place an upper limit on the opencv version
c) Ensure that headers are available

(b) and (c) just copy what the configure.ac checks do.
2016-11-29 02:00:52 +05:30
Sebastian Dröge
7488a8fb35 opencv: Make the OpenCV plugin optional in the meson build 2016-11-27 11:56:18 +02:00
Luis de Bethencourt
de99cf0de1 opencv: Enable in meson build
https://bugzilla.gnome.org/show_bug.cgi?id=774223
2016-11-26 17:55:23 +00:00
Sebastian Dröge
9b89f58cae ext: Fix various compiler warnings with clang
wldisplay.c:179:15: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare]
  if (shm_fmt < 0)
      ~~~~~~~ ^ ~

gstsegmentation.cpp:419:40: error: implicit conversion from 'int' to 'char' changes value from 255 to -1 [-Werror,-Wconstant-conversion]
          filter->cvFG->imageData[j] = 255;
                                     ~ ^~~

https://bugzilla.gnome.org/show_bug.cgi?id=775112
2016-11-25 23:47:15 +02:00
Philippe Renon
d130a19c89 opencv: forward declare opencv types
Forward declare opencv types to avoid exposing them in the API.

https://bugzilla.gnome.org/show_bug.cgi?id=774223
2016-11-21 17:37:46 +01:00
Philippe Renon
5594c7e53e opencv: move base opencv filter class and utilities to gst-libs
https://bugzilla.gnome.org/show_bug.cgi?id=774223
2016-11-14 18:25:57 +00:00
Jimmy Ohn
701e54cecf opencv: Fix memory leak by gst_caps_to_string
gst_caps_to_string function returned allocated memory.
So, It should be freed using g_free function.

https://bugzilla.gnome.org/show_bug.cgi?id=772499
2016-10-06 13:30:17 +03:00
Heinrich Fink
3107f5df76 facedetect: Fix compiler warning with clang 3.8
Use namespace only after it was actually defined by a header.

gstfacedetect.cpp:79:17: error: using directive refers to implicitly-defined namespace 'std' [-Werror]
using namespace std;
                ^
2016-06-10 11:33:52 +03:00
Matthew Waters
044ed50190 opencv/facedetect: fix the build with opencv 3.1.0
- add using namespace std; for std::vector
    - use the cpp header imgproc.hpp file for the cv::ellipse function instead of
      the C header
    - Mat no longer takes IplImage in it's constructors, use the cvarrtomat()
      function instead.

    Fixes a couple of build errors:

    gstfacedetect.cpp:140:30: error: ‘vector’ does not name a type
     structure_and_message (const vector < Rect > &rectangles, const gchar * name,
                                  ^~~~~~
    gstfacedetect.cpp:140:37: error: expected ‘,’ or ‘...’ before ‘<’ token
     structure_and_message (const vector < Rect > &rectangles, const gchar * name,
                                         ^
    gstfacedetect.cpp: In function ‘void structure_and_message(int)’:
    gstfacedetect.cpp:143:13: error: ‘rectangles’ was not declared in this scope
       Rect sr = rectangles[0];

    [...]

    gstfacedetect.cpp: In function ‘void
    gst_face_detect_run_detector(GstFaceDetect*, cv::CascadeClassifier*, gint, gint,
    cv::Rect, std::vector<cv::Rect_<int> >&)’:
    gstfacedetect.cpp:562:31: error: no matching function for call to
    ‘cv::Mat::Mat(IplImage*&, cv::Rect&)’
         Mat roi (filter->cvGray, r);

    [...]

    gstfacedetect.cpp: In function ‘GstFlowReturn
    gst_face_detect_transform_ip(GstOpencvVideoFilter*, GstBuffer*, IplImage*)’:
    gstfacedetect.cpp:594:44: error: no matching function for call to
    ‘cv::Mat::Mat(cv::Mat, bool)’
         Mat mtxOrg (cv::cvarrToMat (img), false);

    [...]

    gstfacedetect.cpp:734:79: error: ‘ellipse’ was not declared in this scope
             ellipse (mtxOrg, center, axes, 0, 0, 360, Scalar (cr, cg, cb), 3, 8,
    0);
2016-05-15 12:29:07 +01:00
Vanessa Chipirras Navalon
4e1aba0923 opencv: segmentation: Ported to OpenCV version 3.1
Add namespace bgsegm, replacement functions and Template class for new
OpenCV versions because these functions have been removed. cvarrToMat() is
added because it is compatible with all versions of OpenCV and the use of
class Mat constructor is eliminated, it is also deprecated in 3.X versions.

Use the namespace cv because some functions are called many times.

This patch keeps compatibility with 2.4

https://bugzilla.gnome.org/show_bug.cgi?id=760473
2016-04-01 12:24:13 +01:00
Vanessa Chipirras Navalon
78cb53ad3c opencv: textoverlay: Ported to OpenCV version 3.1
imgproc_c.h is added because CvFont struct needs it in any 3.x version.
We use this structure in GstOpencvTextOverlay. This keeps compatibility
with 2.4.

https://bugzilla.gnome.org/show_bug.cgi?id=760473
2016-04-01 11:58:24 +01:00
Luis de Bethencourt
9d7b525f19 motioncells: fully construct MotionCells
Some members of MotionCells were not being initialized in the constructor.
Protect from potential garbage memory usage by fully initializing it.
Moving m_frameSize out of the class because it is only used in
performDetectionMotionCells().

CID 1197704
2016-03-31 16:12:04 +01:00
Vanessa Chipirras Navalon
d1266be431 opencv: pyramidsegment: delete element
cvPyrSegmentation() has been deprecated in OpenCV 3.0, and there isn't any
function to replace it. Deleting this element so we can support OpenCV 3.1
without build issues.

https://bugzilla.gnome.org/show_bug.cgi?id=760473
2016-03-30 22:52:03 +01:00
Vanessa Chipirras Navalon
d3b6b8c64f opencv: gstcvsmooth: Ported to OpenCV version 3.1
cvarrToMat() is added because it is compatible with all versions of Opencv
and the use the class constructor Mat is eliminated because is deprecated
in 3.X versions. This keeps compatibility with 2.4.

https://bugzilla.gnome.org/show_bug.cgi?id=760473
2016-03-30 22:13:27 +01:00
Vanessa Chipirras Navalon
0a08e771d4 opencv: grabcut: Ported to OpenCV version 3.1
cvarrToMat() is added because it is compatible with all versions of Opencv
and using the class Mat constructor is eliminated, because is deprecated
in 3.X versions. The use the using namespace cv because is called some
functions many times. This keeps compatibility with 2.4.

https://bugzilla.gnome.org/show_bug.cgi?id=760473
2016-03-30 22:13:14 +01:00
Vanessa Chipirras Navalon
120f32fed4 opencv: faceblur: Ported to OpenCV version 3.1
cvarrToMat() is added because it is compatible with all versions of Opencv
and the use of the class constructor Mat is eliminated because is deprecated
in 3.X versions. Included 'using namespace std' because it is needed for the
Vector class in 3.X versions. This keeps compatibility with 2.4.

https://bugzilla.gnome.org/show_bug.cgi?id=760473
2016-03-30 22:13:00 +01:00
Vanessa Chipirras Navalon
93b83edfe5 opencv: handdetect: Ported to OpenCV version 3.1
cvarrToMat() is added because it is compatible with all versions of Opencv
and the use of the class constructor Mat is eliminated because is deprecated
in 3.X versions. Included 'using namespace std' because it is needed for the
vector class in 3.X versions. This keeps compatibility with 2.4.

https://bugzilla.gnome.org/show_bug.cgi?id=760473
2016-03-30 22:12:47 +01:00
Vanessa Chipirras Navalon
f91b71edde opencv: retinex: Ported to OpenCV version 3.1
cvarrToMat() is added because it is compatible with all versions of Opencv
and using the class constructor Mat is eliminated because is deprecated
in 3.X versions. This keeps compatibility with 2.4.

https://bugzilla.gnome.org/show_bug.cgi?id=760473
2016-03-30 22:12:32 +01:00
Vanessa Chipirras Navalon
037f54d644 opencv: disparity: Ported to OpenCV version 3.1
'METHOD_VAR', 'METHOD_GC' is removed because there aren't equivalent functions
in new OpenCV versions. 'img_right_as_cvMat_rgb', 'img_left_as_cvMat_rgb' and
'depth_map_as_cvMat2' variables is removed because these aren't used.
cvarrToMat() is added because it is compatible with all versions of Opencv
and using the class Mat constructor is eliminated, because is deprecated
in 3.X versions. The use 'using namespace cv' because is called some
functions many times. This keeps compatibility with 2.4.

https://bugzilla.gnome.org/show_bug.cgi?id=760473
2016-03-30 22:12:16 +01:00
Vanessa Chipirras Navalon
4b60b47075 opencv: skindetect: Ported to OpenCV version 3.1
cvCVPixToPlane() has been deprecated in OpenCV 3.0, and there is
function to replace it cvSplit(). The include compat.hpp is deleted because
in 3.X versions doen't exist and it isn't necessary for 2.4.X versions
in this element. This keeps compatibility with 2.4.

https://bugzilla.gnome.org/show_bug.cgi?id=760473
2016-03-30 22:11:49 +01:00
Vanessa Chipirras Navalon
b37c759e52 opencv: Ported to OpenCV version 3.1 OpenCV
configure.ac was changed to work with new versions of OpenCV 3.X.
A new include is added gstopencvutils.cpp because it contains
the previous. This keeps compatibility with 2.4.

https://bugzilla.gnome.org/show_bug.cgi?id=760473
2016-03-30 22:10:58 +01:00
Vineeth TM
8cdfb13658 bad: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763081
2016-03-24 14:56:51 +02:00
Dave Craig
a5eee1e28a disparity: Don't assume that get_current_caps() returns non-NULL caps after has_current_caps()
Remove calls to gst_pad_has_current_caps() which then go on to call
gst_pad_get_current_caps() as the caps can go to NULL in between. Instead just
use gst_pad_get_current_caps() and check for NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=759539
2016-02-23 18:13:37 +02:00