跳转到内容

Basler Vision Connector Messaging: Image Format#

To standardize image transfer between camera streaming applications and image-driven applications, use the following format for transferring images. The ZMQ message consists of a multipart message with each frame/part described below.

This message format is prepared to support the streaming of multiple cameras.

Message Envelope for ZMQ Messages on the Pub/Sub Channel#

Frame Field 描述 键入
1 topic Device identification Binary string (UTF-8) to identify the device in the following syntax: {DeviceID}/stream
2 metadata Metadata Binary metadata JSON (UTF-8)
3 image Image 1 二进制
4 … n image Image n - For multi-stream camera 二进制

Metadata JSON#

Field Optional 键入 默认 描述
version String 1 Metadata format version
count Integer (32-bit unsigned) 1 Number of images on message
timestamp String - Date and time string UTF-8 ISO8601. Application host datetime
detail Image Detail Object Array - Images details

Image Detail Object#

Field Optional 键入 默认 描述
id String - Unique image identifier. Suggested mnemonic format: {camid}_{camstream}_{datetime}
seq Integer (64-bit unsigned) - Sequential number for the camera image. Starting at 1, incremented by 1 on each frame grabbed
height No / Yes (encoded formats) Integer (32-bit unsigned) - Image height
width No / Yes (encoded formats) Integer (32-bit unsigned) - Image width
formatns String Genicam Image format namespace. For GenICam pixel format use Genicam and Compressed for compressed formats.a
format String - Image format ab
linepadding Integer (32-bit unsigned) 0 Number of bytes added to the end of a byte stream to reach a multiple of 4 bytes. E.g. an image with 61 pixels, Mono 8 format, will have a line padding of 3, filling the stream to reach 64 bytes.
timestamp Stringc - Timestamp sent by the camerad

  1. The Basler Vision Connector only supports GenICam, no compressed formats.

  2. For cameras using a standardized GenICam pixel format, it's recommended to use the GenICam naming convention as described in section 4.35 of GenICam_PFNC_2_4.pdf.

  3. A string is used since, in the PTP standard, the tick count is expected to be an 80-bit number. However, the current GenICam protocol returns a 64-bit integer.

  4. Timestamps provided by the cameras are tick counts. Ticks are defined by the camera and therefore vary from camera to camera. This can be either referencing the Unix epoch, or the number of ticks since the camera is on, or count of ticks informed/in sync with the PTP server.

Metadata Example#

{
  "version": "1",
  "count": 1,
  "timestamp": "2014-01-09T13:35:34.000000000+0100",
  "detail":[
    {
      "id":"mycamera_1_2014-01-09T13:35:34.000000000+0100",
      "seq": 3,
      "height": 852,
      "width": 1280,
      "formatns": "Genicam",
      "format": "BGR8",
      "linepadding": 0,
      "timestamp": "123456"
    }
  ]
}