yair 69dcea025e Add rollingsum filter for frame analysis based on column mean deviation
- Implements GStreamer element that analyzes pixel columns
- Drops frames when column mean deviates from rolling baseline
- Configurable window size, column index, stride, and threshold
- Includes design documentation and build script
- Tested successfully with IDS uEye camera source
2025-11-14 03:44:54 +02:00

7.8 KiB

gst-plugins-vision

GStreamer plugins related to the field of machine vision.

we only care for ids,

run using

gst-launch-1.0 idsueyesrc config-file=whole-presacler64_autoexp-binningx2.ini ! queue ! autovideosink

drop frame if sum of image is bigger then 0.5

gst-launch-1.0 idsueyesrc config-file=whole-presacler64_autoexp-binningx2.ini ! videoconvert ! video/x-raw,format=GRAY8 ! rollingsum window-size=1000 column-index=1 threshold=0.5 ! queue ! autovideosink

Note: The rollingsum element analyzes a single column of pixels and drops frames when the column mean deviates from the rolling mean baseline by more than the threshold. Use videoconvert to ensure proper format negotiation.

Additional examples:

# Analyze column 320 with larger window
gst-launch-1.0 idsueyesrc config-file=whole-presacler64_autoexp-binningx2.ini ! videoconvert ! video/x-raw,format=GRAY8 ! rollingsum window-size=5000 column-index=320 threshold=0.3 ! queue ! autovideosink

# Use stride for faster processing (sample every 2 rows)
gst-launch-1.0 idsueyesrc config-file=whole-presacler64_autoexp-binningx2.ini ! videoconvert ! video/x-raw,format=GRAY8 ! rollingsum window-size=1000 column-index=1 stride=2 threshold=0.5 ! queue ! autovideosink

# Lower threshold for more sensitive detection
gst-launch-1.0 idsueyesrc config-file=whole-presacler64_autoexp-binningx2.ini ! videoconvert ! video/x-raw,format=GRAY8 ! rollingsum threshold=0.2 ! queue ! autovideosink

Image acquisition elements

Image generation elements

Other elements

  • extractcolor: Extract a single color channel
  • klvinjector: Inject test synchronous KLV metadata
  • klvinspector: Inspect synchronous KLV metadata
  • rollingsum: Drops frames based on rolling mean analysis of a single column
  • sfx3dnoise: Applies 3D noise to video
  • videolevels: Scales monochrome 8- or 16-bit video to 8-bit, via manual setpoints or AGC

Dependencies

  • GStreamer 1.2.x or newer (1.8 needed for KLV)
  • Specific frame grabber SDKs and/or licenses

Installation

  • Install GStreamer 1.2.x or newer (1.8 needed for KLV)
  • Build project (see below) or download a release from Github (ZIP files under Assets)
  • Extract files somewhere
  • Create an environment variable GST_PLUGIN_PATH that points to where you extracted the files

Examples

Capture from a CoaXPress camera via a Kaya Komodo frame grabber, apply AGC to convert it to 8-bit monochrome, then output the video via A&B Software GigESim which generates GigE Vision video:

gst-launch-1.0 kayasrc ! videolevels auto=continuous ! gigesimsink

Then in another command capture the GigE Vision video via Pleora eBUS and display the video to the screen:

gst-launch-1.0 pleorasrc ! autovideoconvert ! autovideosink

Compiling

Windows

  • Install Git or download a ZIP archive
  • Install CMake
  • Install GStreamer distribution or build from source. The installer should set the installation path via the GSTREAMER_1_0_ROOT_X86_64 environment variable. If not set, set the CMake variable GSTREAMER_ROOT to your installation, the directory containing bin and lib
  • Install any camera or framegrabber software/SDK for those plugins you wish to build. Check cmake/modules for any paths you may need to set.
  • Run the following commands from a terminal or command prompt, assuming CMake and Git are in your PATH.
git clone https://github.com/joshdoe/gst-plugins-vision.git
cd gst-plugins-vision
mkdir build
cd build
cmake -G "Visual Studio 15 2017 Win64" ..

Ubuntu

Steps should be similar on other Linux distributions.

apt-get install git cmake libgstreamer-plugins-base1.0-dev liborc-0.4-dev
git clone https://github.com/joshdoe/gst-plugins-vision.git
cd gst-plugins-vision
mkdir build
cd build
cmake ..
make

Installation and packaging

To install plugins, first make sure you've set CMAKE_INSTALL_PREFIX properly, the default might not be desired (e.g., system path). For finer grained control you can set PLUGIN_INSTALL_DIR and related variables to specify exactly where you want to install plugins

cmake --build . --target INSTALL
# or on Linux
make install
  • To create a package of all compiled plugins run:
cmake --build . --target PACKAGE
# or on Linux
make package

KLV

KLV support is based on a GStreamer merge request that has yet to be merged, so it is included here in the klv library. By default KLV support is disabled. To enable it set the CMake flag ENABLE_KLV. This will create the klv plugin, and make the pleora plugin dependent on the klv library. You'll need to ensure libgstklv-1.0-1.dll is in the system PATH on Windows, or on Linux make sure libgstklv-1.0-1.so is in the LD_LIBRARY_PATH.

See also

  • Aravis, Linux open source GStreamer plugin for GigE Vision and USB3 Vision cameras