GStreamer Based Image Signal Processor/Examples/x86 Pipelines: Difference between revisions

From RidgeRun Developer Wiki
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 6: Line 6:
The GStreamer Based Image Signal Processor element can be easily incorporated into any pipeline. Here we present some sample pipelines for different use cases.
The GStreamer Based Image Signal Processor element can be easily incorporated into any pipeline. Here we present some sample pipelines for different use cases.


=Debayer plugin pipelines examples=
==Debayer plugin pipelines examples==
For this pipeline example the ispcldebayer element will transform the buffer from '''bayer''' format to '''RGBA''' format  
For this pipeline example the ispcldebayer element will transform the buffer from '''bayer''' format to '''RGBA''' format  
<syntaxhighlight lang=bash style="background-color: #f0fff0">
<syntaxhighlight lang=bash style="background-color: #f0fff0">
Line 12: Line 12:
HEIGHT=1080
HEIGHT=1080


gst-launch-1.0 videotestsrc is-live=true ! "video/x-bayer, format=(string)bggr, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispcldebayer ! fakesink -v
gst-launch-1.0 videotestsrc is-live=true ! "video/x-bayer, format=(string)bggr, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispcldebayer platform='Intel(R) OpenCL HD Graphics' ! fakesink -v
</syntaxhighlight>
</syntaxhighlight>


=Color space conversion plugin pipelines examples=
==Color space conversion plugin pipelines examples==
For this example the ispclcsc element will convert the color space from '''RGBA''' to '''NV12''' format.  
For this example the ispclcsc element will convert the color space from '''RGBA''' to '''NV12''' format.  
<syntaxhighlight lang=bash style="background-color: #f0fff0">
<syntaxhighlight lang=bash style="background-color: #f0fff0">
Line 22: Line 22:


gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw,format=(string)RGBA,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! \  
gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw,format=(string)RGBA,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! \  
queue ! ispclcsc ! "video/x-raw,format=(string)NV12,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! fakesink -v
queue ! ispclcsc platform='Intel(R) OpenCL HD Graphics' ! "video/x-raw,format=(string)NV12,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! fakesink -v
</syntaxhighlight>
</syntaxhighlight>


Line 31: Line 31:


gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw,format=(string)NV12,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! \  
gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw,format=(string)NV12,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! \  
queue ! ispclcsc ! "video/x-raw,format=(string)RGBA,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! fakesink -v
queue ! ispclcsc platform='Intel(R) OpenCL HD Graphics' ! "video/x-raw,format=(string)RGBA,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! fakesink -v
</syntaxhighlight>
</syntaxhighlight>


==Bypass feature==
===Bypass feature===
if caps are the same for the input and output the color space converter will act like a bypass:  
if caps are the same for the input and output the color space converter will act like a bypass:  
===RGBA bypass===
====RGBA bypass====
For this example the ispclcsc element will baypass the buffers from '''RGBA''' to '''RGBA'''.
For this example the ispclcsc element will baypass the buffers from '''RGBA''' to '''RGBA'''.
<syntaxhighlight lang=bash style="background-color: #f0fff0">
<syntaxhighlight lang=bash style="background-color: #f0fff0">
Line 46: Line 46:
</syntaxhighlight>
</syntaxhighlight>


===NV12 bypass===
====NV12 bypass====
For this example the ispclcsc element will baypass the buffers from '''NV12''' to '''NV12'''.
For this example the ispclcsc element will baypass the buffers from '''NV12''' to '''NV12'''.
<syntaxhighlight lang=bash style="background-color: #f0fff0">
<syntaxhighlight lang=bash style="background-color: #f0fff0">
Line 53: Line 53:


gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw,format=(string)NV12,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! \  
gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw,format=(string)NV12,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! \  
queue ! ispclcsc ! "video/x-raw,format=(string)NV12,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! fakesink -v
queue ! ispclcsc platform='Intel(R) OpenCL HD Graphics' ! "video/x-raw,format=(string)NV12,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! fakesink -v
</syntaxhighlight>
</syntaxhighlight>




=Histogram equalization plugin pipelines examples=
==Histogram equalization plugin pipelines examples==
For this pipeline example, the ispcleq element will apply an algorithm to improve the image contrast with the histogram equalization technique. This element can do this image improvement using a Bayer input but also NV12 input.  
For this pipeline example, the ispcleq element will apply an algorithm to improve the image contrast with the histogram equalization technique. This element can do this image improvement using a Bayer input but also NV12 input.  
==Bayer RGGB ==
===Bayer RGGB ===
In this case, an average of the histogram components is used on the algorithm.  
In this case, an average of the histogram components is used on the algorithm.  
<syntaxhighlight lang=bash style="background-color: #f0fff0">
<syntaxhighlight lang=bash style="background-color: #f0fff0">
Line 65: Line 65:
HEIGHT=1080
HEIGHT=1080


gst-launch-1.0 videotestsrc is-live=true ! "video/x-bayer, format=(string)bggr, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispcleq ! fakesink -v
gst-launch-1.0 videotestsrc is-live=true ! "video/x-bayer, format=(string)bggr, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispcleq platform='Intel(R) OpenCL HD Graphics' ! fakesink -v
</syntaxhighlight>
</syntaxhighlight>


Line 74: Line 74:
HEIGHT=1080
HEIGHT=1080


gst-launch-1.0 videotestsrc is-live=true ! "video/x-bayer, format=(string)bggr, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispcleq average=false ! fakesink -v
gst-launch-1.0 videotestsrc is-live=true ! "video/x-bayer, format=(string)bggr, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispcleq average=false platform='Intel(R) OpenCL HD Graphics' ! fakesink -v
</syntaxhighlight>
</syntaxhighlight>


==NV12==
===NV12===


<syntaxhighlight lang=bash style="background-color: #f0fff0">
<syntaxhighlight lang=bash style="background-color: #f0fff0">
Line 83: Line 83:
HEIGHT=1080
HEIGHT=1080


gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw, format=NV12, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispcleq ! fakesink -v
gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw, format=NV12, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispcleq platform='Intel(R) OpenCL HD Graphics' ! fakesink -v
</syntaxhighlight>
</syntaxhighlight>




=Auto white balance plugin pipelines examples=
==Auto white balance plugin pipelines examples==
For this pipeline example the ispclawb element will apply an algorithm to improve the image white balance. This element does the image processing in rggb bayer format.  
For this pipeline example the ispclawb element will apply an algorithm to improve the image white balance. This element does the image processing in rggb bayer format.  
<syntaxhighlight lang=bash style="background-color: #f0fff0">
<syntaxhighlight lang=bash style="background-color: #f0fff0">
Line 93: Line 93:
HEIGHT=1080
HEIGHT=1080


gst-launch-1.0 videotestsrc is-live=true ! "video/x-bayer, format=(string)bggr, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispclawb ! fakesink -v
gst-launch-1.0 videotestsrc is-live=true ! "video/x-bayer, format=(string)bggr, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispclawb platform='Intel(R) OpenCL HD Graphics' ! fakesink -v
</syntaxhighlight>
</syntaxhighlight>


Line 99: Line 99:
{{GStreamer Based Image Signal Processor/Foot|Examples/IMX8 Pipelines|Examples/qrbx Pipelines}}
{{GStreamer Based Image Signal Processor/Foot|Examples/IMX8 Pipelines|Examples/qrbx Pipelines}}
</noinclude>
</noinclude>
'''Note''': For each previous example you have to set the appropriate GPU device type, using the element device parameter.

Latest revision as of 23:39, 4 March 2024



Previous: Examples/IMX8 Pipelines Index Next: Examples/qrbx Pipelines





The GStreamer Based Image Signal Processor element can be easily incorporated into any pipeline. Here we present some sample pipelines for different use cases.

Debayer plugin pipelines examples

For this pipeline example the ispcldebayer element will transform the buffer from bayer format to RGBA format

WIDTH=1920
HEIGHT=1080

gst-launch-1.0 videotestsrc is-live=true ! "video/x-bayer, format=(string)bggr, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispcldebayer platform='Intel(R) OpenCL HD Graphics' ! fakesink -v

Color space conversion plugin pipelines examples

For this example the ispclcsc element will convert the color space from RGBA to NV12 format.

WIDTH=1920
HEIGHT=1080

gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw,format=(string)RGBA,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! \ 
queue ! ispclcsc platform='Intel(R) OpenCL HD Graphics' ! "video/x-raw,format=(string)NV12,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! fakesink -v

For this example the ispclcsc element will convert the color space from NV12 to RGBA format.

WIDTH=1920
HEIGHT=1080

gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw,format=(string)NV12,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! \ 
queue ! ispclcsc platform='Intel(R) OpenCL HD Graphics' ! "video/x-raw,format=(string)RGBA,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! fakesink -v

Bypass feature

if caps are the same for the input and output the color space converter will act like a bypass:

RGBA bypass

For this example the ispclcsc element will baypass the buffers from RGBA to RGBA.

WIDTH=1920
HEIGHT=1080

gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw,format=(string)RGBA,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! \ 
queue ! ispclcsc ! "video/x-raw,format=(string)RGBA,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! fakesink -v

NV12 bypass

For this example the ispclcsc element will baypass the buffers from NV12 to NV12.

WIDTH=1920
HEIGHT=1080

gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw,format=(string)NV12,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! \ 
queue ! ispclcsc platform='Intel(R) OpenCL HD Graphics' ! "video/x-raw,format=(string)NV12,width=$WIDTH,height=$HEIGHT,framerate=(fraction)30/1" ! fakesink -v


Histogram equalization plugin pipelines examples

For this pipeline example, the ispcleq element will apply an algorithm to improve the image contrast with the histogram equalization technique. This element can do this image improvement using a Bayer input but also NV12 input.

Bayer RGGB

In this case, an average of the histogram components is used on the algorithm.

WIDTH=1920
HEIGHT=1080

gst-launch-1.0 videotestsrc is-live=true ! "video/x-bayer, format=(string)bggr, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispcleq platform='Intel(R) OpenCL HD Graphics' ! fakesink -v

In case you want to use each component histogram instead of using an average of the components you can set the average property to false.

WIDTH=1920
HEIGHT=1080

gst-launch-1.0 videotestsrc is-live=true ! "video/x-bayer, format=(string)bggr, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispcleq average=false platform='Intel(R) OpenCL HD Graphics' ! fakesink -v

NV12

WIDTH=1920
HEIGHT=1080

gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw, format=NV12, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispcleq platform='Intel(R) OpenCL HD Graphics' ! fakesink -v


Auto white balance plugin pipelines examples

For this pipeline example the ispclawb element will apply an algorithm to improve the image white balance. This element does the image processing in rggb bayer format.

WIDTH=1920
HEIGHT=1080

gst-launch-1.0 videotestsrc is-live=true ! "video/x-bayer, format=(string)bggr, width=$WIDTH, height=$HEIGHT,framerate=(fraction)30/1" ! queue ! ispclawb platform='Intel(R) OpenCL HD Graphics' ! fakesink -v


Previous: Examples/IMX8 Pipelines Index Next: Examples/qrbx Pipelines



Note: For each previous example you have to set the appropriate GPU device type, using the element device parameter.