Module Configuration File

Each module is configured in a file of its own, <module name>.json. The name of the file without .json, in lower case, is the module’s name on the Data Layer: hdvisionsystems/lumiscan-calibration/<module name>. The application ships one example, example.json: the module example.

The configuration defines how 2D image coordinates are converted into 3D coordinates on the calibrated plane, and optionally a stream of points to convert.

{
    "$schema": "schemas/lumiscan-calibration-module.schema.json",
    "meta": {
        "inputFileType": "LumiScan-CtrlX-Calibration-Module",
        "inputFileVersion": "1.0.0",
        "targetMachine": "MachineName",
        "programName": "LumiScan-Calibration",
        "programVersion": "1.0.0"
    },
    "transform": {
        "name": "PlanarProjectionExample",
        "type": "from2dTo3d",
        "subtype": "lookUpTable",
        "relativePathToTiff": "example.tiff",
        "interpolationMethod": "linear4Neighbors",
        "offsetX": 0.0,
        "offsetY": 0.0,
        "scaleX": 1.0,
        "scaleY": 1.0
    },
    "stream": {
        "address": "hdvisionsystems/lumiscan-ai-object-matching/example/control/subscribe/output/stream",
        "onEntry": [
            {
                "kind": "remap",
                "node": "result",
                "array": "instances",
                "x": "oriented_bounding_box.center_x",
                "y": "oriented_bounding_box.center_y"
            }
        ],
        "enable": true,
        "keepLatestOutput": true,
        "queueSize": 64
    }
}

The parameters are described in Table 5. The file may contain comments (// and /* */).

The example’s stream section reads the results of LumiScan AI Object Matching’s example module, example, from the start: the node result of its stream folder, and in it the list instances. It transforms the centre of each box found on the image stream, and also writes the points to the regular output. The results of AI Object Matching are always read this way, with a remap step in onEntry. For a module that reads another source, change the section or remove it: without one, a module streams plain. See Transforming a Stream.

Table 1. Table 5: Module JSON Settings Description
Parameter Description

meta

Metadata of the file. inputFileType and inputFileVersion are required.

meta.inputFileType

The file type. For a module configuration file, the value must be LumiScan-CtrlX-Calibration-Module.

meta.inputFileVersion

The version of the file format. Currently, only 1.0.0 is supported.

meta.targetMachine

Optional. The name of the machine the configuration is intended for.

meta.programName

Optional. The application that uses the file: LumiScan-Calibration.

meta.programVersion

Optional. The application version the configuration was made for.

transform

The coordinate transformation.

transform.name

The transformation’s name, as the log shows it. It does not change the module’s name on the Data Layer.

transform.type

The transformation type. Currently, only "from2dTo3d" is supported.

transform.subtype

The transformation subtype. Currently, only "lookUpTable" is supported.

transform.relativePathToTiff

The path of the TIFF file with the calibration data, relative to this file. See Tiff File.

transform.interpolationMethod

How a value between calibrated points is found: "closestPixel", "linear4Neighbors" or "bilateralInterpolation".

transform.offsetX, transform.offsetY

Offsets subtracted from the input coordinates before the table is looked up. The default is 0.0.

transform.scaleX, transform.scaleY

Factors the input coordinates are scaled by, after the offset, before the table is looked up. The default is 1.0.

stream

Optional, experimental. A stream of points to convert as they arrive: the source and stream mode, and in onEntry the step that reads each update. See Configuring a stream.

After changing the file, reset the module (control/reset): it reads the file and the TIFF file again, without a restart of the application. This applies to the stream section too. Only adding or removing a module needs a restart.

If the file or its TIFF file cannot be loaded, the module is still served, but reports status -2 (invalidSetting) and converts nothing until a reset succeeds.

Complete reference

Every setting of this file as its JSON Schema lumiscan-calibration-module.schema.json defines it, generated for version 2.0.0:

Setting Type Default Allowed values Description

meta

object

Required.

meta/inputFileType

string

not empty

Required.

meta/inputFileVersion

string

not empty

Required.

meta/targetMachine

string

not empty

Required.

meta/programName

string

not empty

Required.

meta/programVersion

string

not empty

Required.

transform

object

Required.

transform/name

string

pattern ^[a-zA-Z0-9_-]+$

Required. only [a-Z], [0-9], '-' and '_' are allowed. Unique ID of the camera configuration. This is used to identify different camera on datalayer.

transform/type

string

from2dTo3d

Required.

transform/subtype

string

lookUpTable

Required.

transform/relativePathToTiff

string

not empty

Required.

transform/interpolationMethod

string

linear4Neighbors, closestPixel

Required.

transform/offsetX

number

Required.

transform/offsetY

number

Required.

transform/scaleX

number

Required.

transform/scaleY

number

Required.