Kinovea GenICam plugin
2024-11-09
4 minutes read

Kinovea now has a universal plugin for machine vision cameras compatible with the GenICam standard.

genicam

You can get the current version of the plugin here: https://www.kinovea.org/setup/plugins/camera/genicam/Kinovea.GenICam-1.1.0.zip

Note: this plugin is only compatible with Kinovea 2024.1.

Machine vision

Typically machine vision camera vendors provide an SDK for third party applications to interact with their cameras. It wasn’t sustainable to implement integration with a new SDK for each vendor, there are dozens of them, with a different API each time. Thankfully the GenICam standard homogenize all of this.

Currently the old plugins are still working but no new ones will be added and I encourage everyone to switch to this new universal plugin.

GenTL

GenICam standardizes the way applications connect to the camera, enumerate properties and grab the camera stream.

The core part of the standard is called GenTL, for Transport Layer. This lets us enumerate the systems (this is an abstract concept but essentially each vendor has its own “system” and we access the lower level abstractions through it), the interfaces (GiGE, USB), the devices, and ultimately connect to a stream and receive the frame buffers.

gentl GenTL hierarchy

In practice this takes the form of one or more .cti files which are actually DLLs, and that implement the bridge between the standard GenICam libraries and the device driver. These .cti files are provided by the each camera vendor, as part of their runtime or SDK.

Stream formats

Typically cameras expose many possible source formats for the raw frame buffers they are sending. Internally Kinovea uses 3 types of frame buffers, RGB32 for color images, Y800 for monochromatic images (either true mono images or Bayer images) and JPEG for pre-compressed streams.

The plugin uses OpenCV to convert the source frame buffers into buffers that Kinovea can use, and to “colorize” Bayer buffers (known as debayering or demosaicing). In some cases this conversion is a simple copy, in other cases it requires transforming each pixel to a different pixel format which has an impact on performances. This is especially important when lowering the vertical resolution in order to increase the framerate.

Performances

For color cameras the nominal framerate announced by the vendor is normally the one for the 8-bit Bayer stream.

If the camera has an “RGB” stream format exposed in the properties (e.g: “RGB8”), the device will typically perform the debayering step on the camera hardware and send color images via the interface. This is not necessarily faster than letting Kinovea do it on the computer side and it incurs an additional cost in bandwidth which very often goes over the maximum bandwidth capacity between the camera and the interface or that of the interface itself. It is usually better to use the raw 8-bit Bayer format as a source and check the option for debayering in the configuration dialog. Feel free to experiment with this if you don’t get the expected framerate.

config Basler camera configured for BayerRG8 + software debayering

Higher bit depths

Many cameras have streams with higher bit depths with corresponding names such as “BayerRG10”, “Mono12”, etc. These formats are always converted to 8-bit by Kinovea on reception. It is thus counter-productive to select these formats in the configuration dialog, they only clog the bandwidth for no improvement in image quality.

In some cases there is an additional property such as “SensorBitDepth” that can be set to 10 bits per pixels (“Bpp10” or similar naming) in the vendor’s configurator. This is also counter-productive and may prevent Kinovea from reaching the full framerate of the camera.

daheng-genicam Daheng camera running its nominal 227 fps at 1440x1080

Usage

  • Unzip the archive somewhere and copy the “GenICam” folder into Kinovea application data folder under the Plugins\Camera directory (you can find the application data folder via Kinovea menu Help > Open log folder).
  • You must still install the drivers and software from your camera vendor separately. If the installer for the vendor runtime or SDK has various options make sure to check the options mentioning “GenICam” or “GenTL”.
  • Restart Kinovea.

Status

Currently I have reports that the new plugin works with cameras from the following vendors:

  • Allied Vision
  • Basler
  • Baumer
  • Daheng imaging
  • IDS
  • Teledyne FLIR
  • Vision Datum

Known issues:

  • With IDS cameras, reducing the image resolution results in a black image. (Not clear if this is only for the UI-xxx cameras or also the newer U3-xxx, if any one has one of these please report).
  • 1 report that Daheng cameras using GigE interface don’t work (USB 3 cameras do work).
  • When using two Teledyne FLIR cameras of the same model at the same time it can crash. One camera should work, as well as two cameras of different models.

Vision Datum

What finally triggered this effort was a request to support cameras from Vision Datum. Many thanks to Vision Datum for donating a test camera and their continued support over several months, including several updates to their own software stack to make sure everything worked well with Kinovea.

Feedback

Please report your experience here.


Back to homepage


comments powered by Disqus