Config file documentation

Type: object Default: {}

Config file schema definition for the tag-grid-scanner.

Default: {}

The configuration of the camera.

Type: object

The following properties are required:

  • id
Type: object

The following properties are required:

  • filename

Type: integer

The index of the camera.

This is system dependent and different devices might be associated with the same index during the runtime of the program. The index and how it is changing is highly system-dependent, but should be safely usable if there is only one camera connected to the system.

Value must be greater or equal to 0

Type: array

The size of the requested camera video stream.

The given size must match one of the supported resolutions of the camera. The result of querying an unsupported size is undefined.

Must contain a minimum of 2 items

Must contain a maximum of 2 items

Each item of this array must be:

Type: integer

A positive integer, i.e. it an integer > 0.

Value must be greater or equal to 1

Type: integer

The number of frames per second of the requested camera video stream.

The given number must match one of the supported number of fps of the camera. The result of querying an unsupported fps is undefined.

Value must be greater or equal to 1

Type: string

The 4-digit code of the requested camera video stream.

A camera might support different stream formats. Selecting a specific format might affect image quality and performance. The most common ones for webcams are 'MJPG' and 'H264'. See also the list of known FOURCCs.

Must be at least 4 characters long

Must be at most 4 characters long

Type: object Default: {}

Calibration data to remove distortion from the image.

Camera lenses are not perfect. Instead, they always introduce some kind of distortion to the image captured by the camera sensor. If the cameras corrects the distortion internally, the calibration data can be ignored, but usually, even the internal correction is not good enough to have perfectly map straight lines in the scene to perfectly straight lines in the camera image. The objects in this section can be generated using the calibrate command of the tag-grid-scanner. See also OpenCV's documentation on camera calibration.

Type: array of array Default: [[1, 0, 0], [0, 1, 0], [0, 0, 1]]

A 3x3 matrix of floating point numbers.

Must contain a minimum of 3 items

Must contain a maximum of 3 items

Each item of this array must be:

Type: array of number

Must contain a minimum of 3 items

Must contain a maximum of 3 items

Each item of this array must be:

Type: array of number Default: [0, 0, 0, 0, 0]

Must contain a minimum of 5 items

Must contain a maximum of 5 items

Each item of this array must be:

Type: number

Type: string

The name of a video file, image or camera device node.

Use this instead of the camera index. It allows to read image data from video files, images or from camera device nodes on certain operating systems such as Linux. The latter is very useful to make sure the correct camera is used in multi-camera systems, since the camera index may change arbitrarily. It is common practice in Linux to wait for a certain camera via UDEV and create a well-defined symlink to the camera device node that can be used reliably here.

Default: 1.0

Scale factor applied to the camera image.

If the camera only provides a fixed resolution or lower than maximum resolution just crop the image instead of scaling it, this scale factor can be used. Lower values will improve the speed of the computation. However, values too low will result in tag detection errors.

Type: number

A non-negative floating point numner, i.e. a floating point number >= 0.0.

Value must be greater or equal to 0.0

Type: array

A 2D vector of non-negative floating point numbers.

Must contain a minimum of 2 items

Must contain a maximum of 2 items

Each item of this array must be:

Type: number

A non-negative floating point numner, i.e. a floating point number >= 0.0.

Value must be greater or equal to 0.0

Type: enum (of integer) Default: 0

Angle of rotation applied to the camera image.

Must be one of:

  • 0
  • 90
  • 180
  • 270

Type: boolean Default: false

Whether to flip the camera image vertically.

Flipping the image needs to be enabled if the camera is seeing the ROI via a mirror, which results in all tags being flipped, too. Flipping the grid (but not the tags) can be reverted in the notify section.

Type: boolean Default: false

Whether to flip the camera image horizontally.

Flipping the image needs to be enabled if the camera is seeing the ROI via a mirror, which results in all tags being flipped, too. Flipping the grid (but not the tags) can be reverted in the notify section.

Type: number Default: 0.0

Blend the current image with previous images.

The current image will be blended with the previous image using the smooth value as the interpolation parameter. At 0.0, the current image will be used exclusively, at 1.0, the previous will be used exclusively (which makes no sense). Values of 0.5 to 0.75 worked reasonably well for reducing noise in the input images due to insufficient lighting. Values closer to one will increase detection latency. It is important to consider this option in the light of the camera's fps, since a constant smooth value will result in different latencies for different fps.

Value must be greater or equal to 0.0 and lesser or equal to 1.0

Type: object Default: {}

The configuration of the tag grid.

Type: array

The size of the tag grid.

How many tags can be placed in each direction?

Must contain a minimum of 2 items

Must contain a maximum of 2 items

Each item of this array must be:

Type: integer

A positive integer, i.e. it an integer > 0.

Value must be greater or equal to 1

Type: array

The size of each tag.

How many pixels does each tag have in each direction?

Must contain a minimum of 2 items

Must contain a maximum of 2 items

Each item of this array must be:

Type: integer

A positive integer, i.e. it an integer > 0.

Value must be greater or equal to 1

Type: array of array Default: [[0, 0], [1, 0], [1, 1], [0, 1]]

The region of interest for the scanner to look for tags.

Provide the vertices of a quadrilateral containing the tag grid in the image. The vertices are relative to the size of the image, i.e. each value should be in [0, 1].

Must contain a minimum of 4 items

Must contain a maximum of 4 items

Each item of this array must be:

Type: array of number

Must contain a minimum of 2 items

Must contain a maximum of 2 items

Each item of this array must be:

Type: array Default: [0, 0]

Size of the gaps in between tags.

The gap size is relative to the image size, i.e. each value should be in [0, 1].

Must contain a minimum of 2 items

Must contain a maximum of 2 items

Each item of this array must be:

Type: number

A floating point number in [0, 1].

Value must be greater or equal to 0.0 and lesser or equal to 1.0

Default: 0.75

Keep this fraction of the center part of each tile's pixel.

In most cases, the tag pixels are not perfectly aligned with the grid in the image. This is usually due to imperfection in the camera lens, calibration or selection of the region of interest. To attenuate this problem, each tag's pixels can be cropped such that only their center part is used for identifying the pixels color.

Type: number

A floating point number in [0, 1].

Value must be greater or equal to 0.0 and lesser or equal to 1.0

Type: array

A 2D vector of floating point numbers in [0, 1].

Must contain a minimum of 2 items

Must contain a maximum of 2 items

Each item of this array must be:

Type: number

A floating point number in [0, 1].

Value must be greater or equal to 0.0 and lesser or equal to 1.0

Type: object Default: {"unknown": -1}

The tags to be detected and their values.

Each tag is represented as a sequence of 1s (white) and 0s (black), written as a single string containing all the pixels line by line (top-left to bottom-right). Each tag has a value assigned that is used for notification purposes. The value is just an ID in most cases, but can be an arbitrary JSON object. The special tag unknown is used to deal with positions in the tag grid where no tag could be identified.

No Additional Properties

The following properties are required:

  • unknown

All property whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^unknown$
Type: object

All property whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^[01]+$
Type: object

Default: {}

Define how the scanner should notify about detected tags.

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: true
Type: object

The following properties are required:

  • url
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: true
Type: object

The following properties are required:

  • interval

Type: object Default: []

The JSON template to which the tag data will be added.

When the scanner outputs a notification, it will use this object as a template and assign the tag data to the JSON pointer defined by the assignTo option.

Type: string Default: ""

JSON pointer into the template option for assigning the tag data during notification.

When the scanner outputs a notification, it will copy the object provided via the template option and assign the tag data to the property defined by this JSON pointer. See also the definition of the JSON pointer format.

Type: enum (of integer) Default: 0

Rotate the grid by the given number of degrees.

Must be one of:

  • 0
  • 90
  • 180
  • 270

Type: boolean Default: false

Flip the grid vertically.

Type: boolean Default: false

Flip the grid horizontally.

Type: boolean Default: true

Output the notification to the standard output stream.

Type: boolean Default: false

Output the notification to the standard error stream.

Type: boolean Default: false

Send the notification to a remote host via HTTP.

Type: string

Send the notification to this URL (HTTP only), when remote is enabled.

Type: boolean Default: false

Repeat the notification even though the detected tags did not changed.

Type: integer

Interval at which notification are repeated in seconds, when repeat is enabled.

Value must be greater or equal to 1