After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 751203 - videostitching: Open CV video stitching plugin based on GstVideoAggregator
videostitching: Open CV video stitching plugin based on GstVideoAggregator
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 746529 748377 753687
Blocks:
 
 
Reported: 2015-06-19 07:38 UTC by kevin
Modified: 2018-11-03 13:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Rename gstopencv.c to gstopencv.cpp (9.27 KB, patch)
2015-06-19 08:30 UTC, kevin
none Details | Review
Add video stitching element. (68.52 KB, patch)
2015-06-19 08:31 UTC, kevin
none Details | Review
test images. (966.50 KB, application/x-gzip)
2015-06-19 08:33 UTC, kevin
  Details
Update to fix memory leakage. (68.38 KB, patch)
2015-06-23 06:25 UTC, kevin
none Details | Review
Add video stitching element based on Open CV. (67.88 KB, patch)
2015-06-24 03:09 UTC, kevin
none Details | Review
The output image of cvstitching. (57.50 KB, image/jpeg)
2015-06-24 03:11 UTC, kevin
  Details
Add video stitching element based on Open CV. (67.80 KB, patch)
2015-08-16 01:05 UTC, kevin
none Details | Review
Add video buffer negotiation support to reuse buffer. (10.93 KB, patch)
2015-10-25 14:29 UTC, kevin
none Details | Review
Video stitching based on Open CV. It is based on GstVideoAggregator. (58.18 KB, patch)
2015-10-25 14:30 UTC, kevin
none Details | Review
videoaggregator: Add buffer pool negotiation support. (11.00 KB, patch)
2017-01-20 02:57 UTC, kevin
none Details | Review
cvstitching: Add open cv video stitching support. (58.01 KB, patch)
2017-01-20 02:57 UTC, kevin
none Details | Review

Description kevin 2015-06-19 07:38:17 UTC
I developed one Open CV video stitching plugin based on GstVideoAggregator.

Test command:

gst-launch-1.0 filesrc  location=IMG_20150529_152901.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152907.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. videostitching name=stitcher stitcher.src ! videoconvert ! ximagesink sync=false

gst-launch-1.0 filesrc  location=IMG_20150529_152901.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152907.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. videostitching feturetypes=0 warptypes=2 seamfindtypes=3 bacostfuncs=1 name=stitcher stitcher.src ! videoconvert ! ximagesink sync=false


gst-launch-1.0 filesrc location=IMG_20150529_152901.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152907.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152913.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152918.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152924.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152929.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152933.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152938.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152942.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152947.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152951.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. videostitching feturetypes=0 warptypes=2 seamfindtypes=3 bacostfuncs=1 name=stitcher stitcher.src ! videoconvert ! ximagesink sync=false
Comment 1 Thibault Saunier 2015-06-19 07:50:24 UTC
And do you plan to share the code? :)
Comment 2 kevin 2015-06-19 08:30:37 UTC
Created attachment 305643 [details] [review]
Rename gstopencv.c to gstopencv.cpp
Comment 3 kevin 2015-06-19 08:31:03 UTC
Created attachment 305644 [details] [review]
Add video stitching element.
Comment 4 kevin 2015-06-19 08:33:37 UTC
Created attachment 305645 [details]
test images.
Comment 5 Nicolas Dufresne (ndufresne) 2015-06-19 12:55:09 UTC
Nice, note that I'd call it cvstiching, so we can avoid using too generic names.
Comment 6 kevin 2015-06-23 06:25:37 UTC
Created attachment 305887 [details] [review]
Update to fix memory leakage.
Comment 7 kevin 2015-06-23 06:27:01 UTC
(In reply to Nicolas Dufresne (stormer) from comment #5)
> Nice, note that I'd call it cvstiching, so we can avoid using too generic
> names.

yes, there are many kinds of method to do video stitching. I will change the name later.
Comment 8 Nicolas Dufresne (ndufresne) 2015-06-23 13:18:42 UTC
Thanks.
Comment 9 kevin 2015-06-24 03:09:20 UTC
Created attachment 305975 [details] [review]
Add video stitching element based on Open CV.

Rename videostitching to cvstitching.
Comment 10 kevin 2015-06-24 03:11:23 UTC
Created attachment 305976 [details]
The output image of cvstitching.
Comment 11 kevin 2015-06-24 03:18:18 UTC
New test command line:

gst-launch-1.0 filesrc  location=IMG_20150529_152901.jpg ! jpegdec ! videoconvert ! stitcher. filesrc location=IMG_20150529_152907.jpg ! jpegdec ! videoconvert ! stitcher. cvstitching name=stitcher stitcher.src ! videoconvert ! ximagesink sync=false


gst-launch-1.0 filesrc  location=IMG_20150529_152901.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152907.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. cvstitching feturetypes=1 warptypes=2 seamfindtypes=0 bacostfuncs=1 name=stitcher stitcher.src ! videoconvert ! ximagesink sync=false


gst-launch-1.0 filesrc location=IMG_20150529_152901.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152907.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152913.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152918.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. cvstitching feturetypes=1 warptypes=2 seamfindtypes=0 bacostfuncs=1 name=stitcher stitcher.src ! videoconvert ! ximagesink sync=false


gst-launch-1.0 filesrc location=IMG_20150529_152901.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152907.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152913.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152918.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152924.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152929.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152933.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152938.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152942.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152947.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152951.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. cvstitching feturetypes=1 warptypes=2 seamfindtypes=0 bacostfuncs=1 name=stitcher stitcher.src ! videoconvert ! ximagesink sync=false
Comment 12 kevin 2015-07-07 08:33:34 UTC
Help to review or any suggestion?
Comment 13 kevin 2015-07-24 03:45:05 UTC
Review of attachment 305643 [details] [review]:

748377 already fix this. Will verify the cvstitching element after 748377 resolved.
Comment 14 kevin 2015-08-16 01:05:48 UTC
Created attachment 309343 [details] [review]
Add video stitching element based on Open CV.

Update based on latest code.
Comment 15 kevin 2015-08-16 01:07:09 UTC
test command line:

gst-launch-1.0 filesrc  location=IMG_20150529_152901.jpg ! jpegparse ! jpegdec ! videoconvert ! imagefreeze ! video/x-raw,format=RGB ! stitcher. filesrc location=IMG_20150529_152907.jpg ! jpegparse ! jpegdec ! videoconvert ! imagefreeze ! video/x-raw,format=RGB ! stitcher. cvstitching feturetypes=1 name=stitcher stitcher.src ! videoconvert ! xvimagesink sync=false
Comment 16 kevin 2015-08-16 15:08:09 UTC
The test command line should be below after https://bugzilla.gnome.org/show_bug.cgi?id=753687

gst-launch-1.0 filesrc  location=IMG_20150529_152901.jpg ! jpegparse ! jpegdec ! imagefreeze ! videoconvert ! stitcher. filesrc location=IMG_20150529_152907.jpg ! jpegparse ! jpegdec ! imagefreeze ! videoconvert ! stitcher. cvstitching feturetypes=1 name=stitcher stitcher.src ! videoconvert ! xvimagesink sync=false
Comment 17 Matthew Waters (ystreet00) 2015-10-15 22:22:02 UTC
Review of attachment 309343 [details] [review]:

I had a quick look at this.  The base class you create, GstOpenCVAggregator, seems like a lot of the negotiation code should be merged into GstAggregator/GstVideoAggregator directly.  See https://bugzilla.gnome.org/show_bug.cgi?id=746529 for that effort.

::: ext/opencv/gstcvstitching.cpp
@@ +52,3 @@
+ * <title>Example launch line</title>
+ * |[
+ * gst-launch-1.0 filesrc  location=IMG_20150529_152901.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152907.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. cvstitching name=stitcher stitcher.src ! videoconvert ! ximagesink sync=false

Should probably split these up to avoid going over 80 chars.

@@ +55,3 @@
+ * ]| image stitching.
+ * |[
+ * gst-launch-1.0 filesrc location=IMG_20150529_152901.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152907.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152913.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152918.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152924.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152929.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152933.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152938.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152942.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152947.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152951.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. cvstitching name=stitcher stitcher.src ! videoconvert ! ximagesink sync=false

and here

@@ +81,3 @@
+float match_conf = 0.3f;
+int blend_type = Blender::MULTI_BAND;
+float blend_strength = 5;

These should at least be static or added to the class if they can be changed dynamically.  Most of these seem like they would be good candidates for properties.

@@ +187,3 @@
+  static const GEnumValue cv_stitching_feature_type[] = {
+    {GST_CV_STITCHING_FEATURE_TYPES_SURF, "feature type surf", "surf"},
+    {GST_CV_STITCHING_FEATURE_TYPES_ORB, "feature type surf", "orb"},

s/surf/orb/ ?

@@ +564,3 @@
+    (*stitcher->finder)(img, features[i]);
+    features[i].img_idx = i;
+    //LOGLN("Features in image #" << i+1 << ": " << features[i].keypoints.size());

Either remove or add as a GST_DEBUG log.

@@ +613,3 @@
+    cameras[i].R.convertTo(R, CV_32F);
+    cameras[i].R = R;
+    //LOGLN("Initial intrinsics #" << indices[i]+1 << ":\n" << cameras[i].K());

GST logging or remove.  I won't highlight the rest.
Comment 18 kevin 2015-10-21 01:58:38 UTC
Thanks review. Will update based on review later.
Comment 19 kevin 2015-10-25 14:29:24 UTC
Created attachment 314072 [details] [review]
Add video buffer negotiation support to reuse buffer.
Comment 20 kevin 2015-10-25 14:30:35 UTC
Created attachment 314073 [details] [review]
Video stitching based on Open CV. It is based on GstVideoAggregator.
Comment 21 kevin 2017-01-20 02:57:23 UTC
Created attachment 343852 [details] [review]
videoaggregator: Add buffer pool negotiation support.
Comment 22 kevin 2017-01-20 02:57:56 UTC
Created attachment 343853 [details] [review]
cvstitching: Add open cv video stitching support.
Comment 23 kevin 2017-01-20 02:58:37 UTC
Update to latest version.
Comment 24 GStreamer system administrator 2018-11-03 13:36:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/260.