Skip to content

gaussblur: independent kernel from sigma value

diegonieto requested to merge diegonieto/gstreamer:gb-independent-kernel into main

Currently the value of the sigma value determines the kernel size in a way that may slow down quite a lot the computations. With this change we allow to provide an external kernel to be applied with the same algorithm. New parameters:

  • kernel-size: the size of the kernel, same as windowsize
  • kernel: the kernel to provide. Instead of generate a new one

This allows to generate effects with given kernels without the need of walk through generated windowsizes. The following illustrates an example:

  • Usuario mode: gst-launch-1.0 videotestsrc num-buffers=300 ! "video/x-raw,width=640,height=480" ! videoconvert ! gaussianblur sigma=-2 ! videoconvert ! autovideosink
  • New mode: gst-launch-1.0 videotestsrc num-buffers=300 ! "video/x-raw,width=640,height=480" ! videoconvert ! gaussianblur kernel-size=3 kernel="<(float)-0.319168, (float)1.638336, (float)-0.319168>" ! videoconvert ! autovideosink

In this was, the second one is able to produce a similar effect with the given array (with size=3), instead of generating the corresponding one (which would have a size=11), so reducing the processing time.

Edited by diegonieto

Merge request reports