Targetless Overlapping Camera Calibration API
Last updated
Last updated
The API requires the client to upload the images and configuration for camera setup in a zip file (.zip extension) in the format defined below. The contents of the zip file are called a dataset.
The client makes an Upload and calibrate API call, which uploads their files and runs the calibration algorithm on the images for the given configuration.
If the Upload and calibrate API call response contains dataset_id, extrinsic_parameters, and error_stats, the calibration process is completed without errors.
The client can call the Get Extrinsic Parameters API using the dataset_id obtained from the Upload and calibrate API. This API responds with dataset_id, extrinsic_parameters, and error_stats.
We require pairs of images from Camera-1 and Camera-2 for a given calibration.
Place the images captured from Camera-1 in a folder.
Place the images captured from Camera-2 in a folder.
config.json contains configuration details of the calibration (intrinsic parameters, calibration name, etc.)
Note: Folder structure is optional. Users can place all files in the main directory and zip it.
The names of the folders and the images shown here are for demonstration purposes. Users should avoid using space in the folder and the image names.
The name of the JSON file should be config.json
(case sensitive)
Key | Value type | Description |
---|---|---|
calibration_name | string | Name of the calibration |
calibration_type | string | Non-editable field. *Value should be stereo_camera_calibration |
calibration_approach | string | Non-editable field. *Value should be targetless |
calibration_group_id | string | This is an optional key. Provide valid calibration_group_id to add the dataset to calibration group. |
version | integer | Non-editable field *Value should be kept 1. |
type | string | Non-editable field Describes the kind of sensor, *value should be kept camera |
camera_name | string | It is the name given by the client to the camera. The client can modify it as willed. |
lens_model | string | Describes the type of lens used by the camera. Accepted values
|
order | int | An integer value to differentiate Camera-1 and Camera-2 inputs.
|
distance_between_two_cameras | double | Distance between Camera-1 and Camera-2 in meters. |
fx | double | Focal length of the cameras in the X-axis. Value in pixels. |
fy | double | Focal length of the camera in the Y-axis. Value in pixels. |
cx | double | Optical centre of the camera in the X-axis. Value in pixels. |
cy | double | Optical centre of the camera in the Y-axis. Value in pixels. |
distortion_enabled | boolean | Makes use of distortion coefficients (k1, k2, k3, k4, p1, p2) for the calibration algorithm when set true. Distortion coefficients (k1, k2, k3, k4, p1, p2) are not required if it is false. |
k1, k2, k3, k4, p1, p2 | double | These are the values for distortion coefficients of the camera lens. Note:
|
data | dict | It stores the data related to mapping of the images |
mappings | List of lists | It is a list of lists, where each sub-list is a tuple containing names of the images paired together. Note:
|
Before invoking the APIs, the client must obtain the clientId and auth token from Deepen AI. If you are a calibration admin, you can create different Access Tokens using the UI and use those instead. clientId is part of the path parameters in most API calls, and the auth token should be prefixed with “Bearer“ and passed to the ‘Authorization’ header in all API requests. How to get Access Tokens can be found on the following link: Access token for APIs
This POST api call sends a zip file to the server and runs the calibration algorithm. Returns dataset_id, extrinsic_parameters, and error_stats to the user as the response.
https://tools.calibrate.deepen.ai/api/v2/external/clients/{clientId}/calibration_dataset
Parameter name | Parameter type | Description |
---|---|---|
clientId | string | ClientId obtained from Deepen AI |
Key | Value | Description |
---|---|---|
file | .zip file | Zip file containing config and images in a suitable format |
Key | Status |
---|---|
dataset_id | A unique value to identify the dataset. dataset_id can be used to retrieve the extrinsic parameters. |
extrinsic_parameters | roll, pitch, and yaw are given in degrees and px, py, and pz are given in meters. |
error_stats | Epiline Point Distance: Average pixel distance of each point to its corresponding projected epiline. Epipolar Error: Proportional to the distance of a point from its epiline. Does not have a physical meaning. It is the residual error from minimizing the epipolar constraints while calculating the fundamental/essential matrix. |
If the data is empty. 'status': "error no files found"
This GET api call returns dataset_id, extrinsic_parameters, and error_stats.
https://tools.calibrate.deepen.ai/api/v2/external/datasets/{datasetId}/extrinsic_parameters
Parameter name | Parameter type | Description |
---|---|---|
datasetId | string | datasetId obtained from the response of Upload file and calibrate API. |
Key | Description |
---|---|
dataset_id | A unique value to identify the dataset. dataset_id can be used to retrieve the extrinsic parameters. |
extrinsic_parameters | roll, pitch, and yaw are given in degrees and px, py, and pz are given in meters. |
error_stats | Epiline Point Distance: Average pixel distance of each point to its corresponding projected epiline. Epipolar Error: Proportional to the distance of a point from its epiline. Does not have a physical meaning. It is the residual error from minimizing the epipolar constraints while calculating the fundamental/essential matrix |
Missing keys in the config.json (Example: order key is missing)