Calibration Schema#

The JSON schema definition for calibration is as follows:

    {
        "type": "object",
        "additionalProperties": false,
        "properties": {
            "version": {
                "type": "string",
                "minLength": 1,
                "maxLength": 10000
            },
            "osmURL": {
                "type": "string",
                "minLength": 0,
                "maxLength": 10000
            },
            "calibrationType": {
                "type": "string",
                "enum": [
                    "geo",
                    "cartesian",
                    "image"
                ]
            },
            "sensors": {
                "type": "array",
                "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "type": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 10000
                        },
                        "id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 10000
                        },
                        "origin": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "lat": {
                                    "type": "number",
                                    "minimum": -90,
                                    "maximum": 90
                                },
                                "lng": {
                                    "type": "number",
                                    "minimum": -180,
                                    "maximum": 180
                                }
                            },
                            "required": [
                                "lat",
                                "lng"
                            ]
                        },
                        "geoLocation": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "lat": {
                                    "type": "number",
                                    "minimum": -90,
                                    "maximum": 90
                                },
                                "lng": {
                                    "type": "number",
                                    "minimum": -180,
                                    "maximum": 180
                                }
                            },
                            "required": [
                                "lat",
                                "lng"
                            ]
                        },
                        "coordinates": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "x": {
                                    "type": "number",
                                    "minimum": -999999,
                                    "maximum": 999999
                                },
                                "y": {
                                    "type": "number",
                                    "minimum": -999999,
                                    "maximum": 999999
                                },
                                "z": {
                                    "type": "number",
                                    "minimum": -999999,
                                    "maximum": 999999
                                }
                            },
                            "required": [
                                "x",
                                "y"
                            ]
                        },
                        "translationToGlobalCoordinates": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "x": {
                                    "type": "number",
                                    "minimum": -999999,
                                    "maximum": 999999
                                },
                                "y": {
                                    "type": "number",
                                    "minimum": -999999,
                                    "maximum": 999999
                                },
                                "z": {
                                    "type": "number",
                                    "minimum": -999999,
                                    "maximum": 999999
                                }
                            },
                            "required": [
                                "x",
                                "y"
                            ]
                        },
                        "scaleFactor": {
                            "type": "number"
                        },
                        "attributes": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 10000
                                    },
                                    "value": {
                                        "type": "string",
                                        "minLength": 0,
                                        "maxLength": 999999999
                                    }
                                },
                                "required": [
                                    "name",
                                    "value"
                                ]
                            }
                        },
                        "group": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "name": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 10000
                                },
                                "type": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 10000
                                },
                                "origin": {
                                    "type": "array",
                                    "minItems": 2,
                                    "maxItems": 2,
                                    "items": {
                                        "type": "number",
                                        "minimum": -999999,
                                        "maximum": 999999
                                    }
                                },
                                "dimensions": {
                                    "type": "array",
                                    "minItems": 4,
                                    "maxItems": 4,
                                    "items": {
                                        "type": "number",
                                        "minimum": -999999,
                                        "maximum": 999999
                                    }
                                },
                                "alias":{
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 10000
                                }
                            },
                            "required": [
                                "name",
                                "type",
                                "origin",
                                "dimensions"
                            ]
                        },
                        "region": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "placeLevel": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 10000
                                },
                                "origin": {
                                    "type": "array",
                                    "minItems": 2,
                                    "maxItems": 2,
                                    "items": {
                                        "type": "number",
                                        "minimum": -999999,
                                        "maximum": 999999
                                    }
                                },
                                "dimensions": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                        "length": {
                                            "type": "number",
                                            "minimum": -999999,
                                            "maximum": 999999
                                        },
                                        "width": {
                                            "type": "number",
                                            "minimum": -999999,
                                            "maximum": 999999
                                        }
                                    },
                                    "required": [
                                        "length",
                                        "width"
                                    ]
                                }
                            },
                            "required": [
                                "placeLevel",
                                "origin",
                                "dimensions"
                            ]
                        },
                        "place": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 10000
                                    },
                                    "value": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 10000
                                    }
                                },
                                "required": [
                                    "name",
                                    "value"
                                ]
                            }
                        },
                        "imageCoordinates": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                    "x": {
                                        "type": "number",
                                        "minimum": -999999,
                                        "maximum": 999999
                                    },
                                    "y": {
                                        "type": "number",
                                        "minimum": -999999,
                                        "maximum": 999999
                                    }
                                },
                                "required": [
                                    "x",
                                    "y"
                                ]
                            }
                        },
                        "globalCoordinates": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                    "x": {
                                        "type": "number",
                                        "minimum": -999999,
                                        "maximum": 999999
                                    },
                                    "y": {
                                        "type": "number",
                                        "minimum": -999999,
                                        "maximum": 999999
                                    },
                                    "z": {
                                        "type": "number",
                                        "minimum": -999999,
                                        "maximum": 999999
                                    }
                                },
                                "required": [
                                    "x",
                                    "y"
                                ]
                            }
                        },
                        "intrinsicMatrix": {
                            "type": "array",
                            "minItems": 3,
                            "maxItems": 3,
                            "items": {
                                "type": "array",
                                "minItems": 3,
                                "maxItems": 3,
                                "items": {
                                    "type": "number",
                                    "minimum": -999999,
                                    "maximum": 999999
                                }
                            }
                        },
                        "extrinsicMatrix": {
                            "type": "array",
                            "minItems": 3,
                            "maxItems": 3,
                            "items": {
                                "type": "array",
                                "minItems": 4,
                                "maxItems": 4,
                                "items": {
                                    "type": "number",
                                    "minimum": -999999,
                                    "maximum": 999999
                                }
                            }
                        },
                        "cameraMatrix": {
                            "type": "array",
                            "minItems": 3,
                            "maxItems": 3,
                            "items": {
                                "type": "array",
                                "minItems": 4,
                                "maxItems": 4,
                                "items": {
                                    "type": "number",
                                    "minimum": -999999,
                                    "maximum": 999999
                                }
                            }
                        },
                        "homography": {
                            "type": "array",
                            "minItems": 3,
                            "maxItems": 3,
                            "items": {
                                "type": "array",
                                "minItems": 3,
                                "maxItems": 3,
                                "items": {
                                    "type": "number",
                                    "minimum": -999999,
                                    "maximum": 999999
                                }
                            }
                        },
                        "rois": {
                            "type": "array",
                            "minItems": 0,
                            "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                    "id": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 10000
                                    },
                                    "type": {
                                        "type": "string",
                                        "minLength": 0,
                                        "maxLength": 10000
                                    },
                                    "roiCoordinates": {
                                        "type": "array",
                                        "minItems": 3,
                                        "items": {
                                            "type": "object",
                                            "additionalProperties": false,
                                            "properties": {
                                                "x": {
                                                    "type": "number",
                                                    "minimum": -999999,
                                                    "maximum": 999999
                                                },
                                                "y": {
                                                    "type": "number",
                                                    "minimum": -999999,
                                                    "maximum": 999999
                                                },
                                                "z": {
                                                    "type": "number",
                                                    "minimum": -999999,
                                                    "maximum": 999999
                                                }
                                            },
                                            "required": [
                                                "x",
                                                "y"
                                            ]
                                        }
                                    },
                                    "restrictedObjectTypes": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 10000
                                        }
                                    },
                                    "confinedObjectTypes": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 10000
                                        }
                                    }
                                },
                                "required": [
                                    "id",
                                    "roiCoordinates"
                                ]
                            }
                        },
                        "tripwires": {
                            "type": "array",
                            "minItems": 0,
                            "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                    "id": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 10000
                                    },
                                    "wire": {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "patternProperties": {
                                            "^p\\d+$": {
                                                "type": "object",
                                                "additionalProperties": false,
                                                "properties": {
                                                    "x": {
                                                        "type": "number",
                                                        "minimum": -999999,
                                                        "maximum": 999999
                                                    },
                                                    "y": {
                                                        "type": "number",
                                                        "minimum": -999999,
                                                        "maximum": 999999
                                                    }
                                                },
                                                "required": [
                                                    "x",
                                                    "y"
                                                ]
                                            }
                                        },
                                        "minProperties": 2,
                                        "errorMessage": {
                                            "minProperties": "wire must have at least 2 points (p1, p2, etc.)"
                                        }
                                    },
                                    "direction": {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                            "p1": {
                                                "type": "object",
                                                "additionalProperties": false,
                                                "properties": {
                                                    "x": {
                                                        "type": "number",
                                                        "minimum": -999999,
                                                        "maximum": 999999
                                                    },
                                                    "y": {
                                                        "type": "number",
                                                        "minimum": -999999,
                                                        "maximum": 999999
                                                    }
                                                },
                                                "required": [
                                                    "x",
                                                    "y"
                                                ]
                                            },
                                            "p2": {
                                                "type": "object",
                                                "additionalProperties": false,
                                                "properties": {
                                                    "x": {
                                                        "type": "number",
                                                        "minimum": -999999,
                                                        "maximum": 999999
                                                    },
                                                    "y": {
                                                        "type": "number",
                                                        "minimum": -999999,
                                                        "maximum": 999999
                                                    }
                                                },
                                                "required": [
                                                    "x",
                                                    "y"
                                                ]
                                            }
                                        },
                                        "required": [
                                            "p1",
                                            "p2"
                                        ]
                                    }
                                },
                                "required": [
                                    "id",
                                    "wire",
                                    "direction"
                                ]
                            }
                        }
                    },
                    "required": [
                        "type",
                        "id",
                        "origin",
                        "geoLocation",
                        "coordinates",
                        "scaleFactor",
                        "attributes",
                        "place",
                        "imageCoordinates",
                        "globalCoordinates"
                    ]
                }
            },
            "rois": {
                "type": "array",
                "minItems": 0,
                "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 10000
                        },
                        "type": {
                            "type": "string",
                            "minLength": 0,
                            "maxLength": 10000
                        },
                        "roiCoordinates": {
                            "type": "array",
                            "minItems": 3,
                            "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                    "x": {
                                        "type": "number",
                                        "minimum": -999999,
                                        "maximum": 999999
                                    },
                                    "y": {
                                        "type": "number",
                                        "minimum": -999999,
                                        "maximum": 999999
                                    },
                                    "z": {
                                        "type": "number",
                                        "minimum": -999999,
                                        "maximum": 999999
                                    }
                                },
                                "required": [
                                    "x",
                                    "y"
                                ]
                            }
                        },
                        "sensors": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 10000
                            }
                        },
                        "groups": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 10000
                            }
                        },
                        "restrictedObjectTypes": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 10000
                            }
                        },
                        "confinedObjectTypes": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 10000
                            }
                        }
                    },
                    "required": [
                        "id",
                        "roiCoordinates",
                        "sensors",
                        "groups"
                    ]
                }
            },
            "tripwires": {
                "type": "array",
                "minItems": 0,
                "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 10000
                        },
                        "wire": {
                            "type": "object",
                            "additionalProperties": false,
                            "patternProperties": {
                                "^p\\d+$": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                        "x": {
                                            "type": "number",
                                            "minimum": -999999,
                                            "maximum": 999999
                                        },
                                        "y": {
                                            "type": "number",
                                            "minimum": -999999,
                                            "maximum": 999999
                                        }
                                    },
                                    "required": [
                                        "x",
                                        "y"
                                    ]
                                }
                            },
                            "minProperties": 2,
                            "errorMessage": {
                                "minProperties": "wire must have at least 2 points (p1, p2, etc.)"
                            }
                        },
                        "direction": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "p1": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                        "x": {
                                            "type": "number",
                                            "minimum": -999999,
                                            "maximum": 999999
                                        },
                                        "y": {
                                            "type": "number",
                                            "minimum": -999999,
                                            "maximum": 999999
                                        }
                                    },
                                    "required": [
                                        "x",
                                        "y"
                                    ]
                                },
                                "p2": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                        "x": {
                                            "type": "number",
                                            "minimum": -999999,
                                            "maximum": 999999
                                        },
                                        "y": {
                                            "type": "number",
                                            "minimum": -999999,
                                            "maximum": 999999
                                        }
                                    },
                                    "required": [
                                        "x",
                                        "y"
                                    ]
                                }
                            },
                            "required": [
                                "p1",
                                "p2"
                            ]
                        },
                        "sensors": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 10000
                            }
                        },
                        "groups": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 10000
                            }
                        }
                    },
                    "required": [
                        "id",
                        "wire",
                        "direction",
                        "sensors",
                        "groups"
                    ]
                }
            },
            "corridors": {
                "type": "array",
                "minItems": 1,
                "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 10000
                        },
                        "sensors": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 10000
                            }
                        },
                        "directions": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 10000
                            }
                        },
                        "length": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 99999999
                        }
                    },
                    "required": [
                        "name",
                        "sensors",
                        "directions",
                        "length"
                    ]
                }
            }
        },
        "required": [
            "version",
            "osmURL",
            "calibrationType",
            "sensors"
        ]
    }

The core sensor specific parameters are under the sensors section. It includes the parameters for coordinates transformation between pixel domain and global coordinate system as well as other meta info used for various applications. A brief description of the parameters is as follows:

Sensor Configuration Parameters#

Parameter

Description

type

String identifier for the sensor type

id

Unique string identifier for the sensor

origin

Geographic coordinates (latitude/longitude) defining the sensor’s origin point

geoLocation

Geographic coordinates (latitude/longitude) specifying the sensor’s physical location

coordinates

Cartesian coordinates (x,y,z) of the sensor in local space, z is optional

translationToGlobalCoordinates

Translation vector (x,y,z) to convert between global coordinates and floor plan map, z is optional. This is used when the origin is not matched between floor plan map and global coordinate system. This field is mainly used in pair with scaleFactor in our simulation-based calibration.

scaleFactor

Numerical factor for scaling between global coordinates and floor plan map. This is used when the scale is not matched between floor plan map and global coordinate system. This field is mainly used in pair with translationToGlobalCoordinates in our simulation-based calibration.

attributes

Array of name-value pairs for additional sensor attributes

group

Group configuration including name, type, origin coordinates, and dimensions

region

Region definition with place level, origin coordinates, and dimensions

place

Array of name-value pairs defining the sensor’s location hierarchy

imageCoordinates

Array of 2D points (x,y) in image space. This is used in pair with globalCoordinates as the core calibration properties to define the transformation between image space and global coordinate space.

globalCoordinates

Array of points (x,y,z) in global coordinate space, z is optional. This is used in pair with imageCoordinates as the core calibration properties to define the transformation between image space and global coordinate space.

intrinsicMatrix

3x3 camera intrinsic parameter matrix. This is used for 3D workflows. Our simulation-based calibration can generate this matrix or you can find it for any camera following the instructions in our manual calibration guide.

extrinsicMatrix

3x4 camera extrinsic parameter matrix. This is used for 3D workflows. Our simulation-based calibration can generate this matrix or you can find it for any camera following the instructions in our manual calibration guide.

cameraMatrix

3x4 combined camera projection matrix. This is the camera projection matrix which is the combination of intrinsic and extrinsic matrices. Our simulation-based calibration can generate this matrix or you can find it for any camera following the instructions in our manual calibration guide. It is optional.

homography

3x3 homography transformation matrix. This is a derived matrix from intrinsicMatrix and extrinsicMatrix. It is optional.

ROIs

Array of regions of interest with coordinates and object type restrictions. This is used for ROI related events and safety alerts. ROIs defined here are in global coordinate system and are sensor specific. User can define non-sensor specific (global) ROIs as well outside of sensors section as defined in the JSON schema above.

tripwires

Array of tripwire definitions with wire coordinates and direction vectors. This is used for tripwire related events and safety alerts. Tripwires defined here are in global coordinate system and are sensor specific. tripwire.wire supports polyline, and additional segments can be created by simply adding more points (e.g. p3, p4, and so on). User can define non-sensor specific (global) tripwires as well outside of sensors section as defined in the JSON schema above.