Given a cuboid
entry in params.geometries
, Scale will annotate your image or video with perspective cuboids and return the vertices of the cuboids. If camera intrinsics and extrinsics are provided as well, Scale will return scale-invariant 3D coordinates with respect to the camera, i.e. assuming the camera is at the origin. See https://scale.com/blog/3d-cuboids-annotations for a detailed explanation of how we can augment 2D cuboid responses.
Request Parameters
Parameter | Type | Default | Description |
---|---|---|---|
objects_to_annotate | array | [] | A list of |
min_height | integer | 0 | The minimum height in pixels of the cuboids you'd like to be made. |
min_width | integer | 0 | The minimum width in pixels of the cuboids you'd like to be made. |
camera_intrinsics | object | null | An object that defines camera intrinsics, in format |
camera_rotation_quaternion | object | null | Object that defines the rotation of the camera in relation to the world. Expressed as a quaternion, in format |
camera_height | number | null | The height of camera above the ground, in meters. Use in conjunction with |
{
...
"geometries": {
"cuboid": {
"objects_to_annotate": [
"car"
],
"min_height": 10,
"min_width": 10,
"camera_intrinsics": {
"fx": 986.778503418,
"fy": 984.4254150391,
"cx": 961.078918457,
"cy": 586.9694824219,
"skew": 0,
"scale_factor": 1
},
"camera_rotation_quaternion": {
"w": 0.0197866653,
"x": 0.0181939654,
"y": 0.6981190587,
"z": -0.715476937
},
"camera_height": -0.2993970777
}
},
...
}
Response Fields
Key | Type | Description |
---|---|---|
uuid | string | A computer-generated unique identifier for this annotation. In video annotation tasks, this can be used to track the same object across frames. |
type | string | String to indicate geometry type: |
label | string | The label of this annotation, chosen from the |
attributes | object | See the Annotation Attributes section for more details about the |
vertices | array of | A list of |
edges | array of | A list of |
points_2d | array of | If |
points_3d | array of | If |
Points on the cuboid are returned in this order for both points_2d and points_3d:
3-------2
/| /|
/ | / |
0-------1 |
| 7----|--6
| / | /
4-------5
Definition: Vertex
Vertex
Key | Type | Description |
---|---|---|
x | number | The distance, in pixels, between the vertex and the left border of the image. |
y | number | The distance, in pixels, between the vertex and the top border of the image. |
type | string | Always |
description | string | An enum describing the position of the vertex, which is one of:
|
Definition: Edge
Edge
Key | Type | Description |
---|---|---|
x1 | number | The distance, in pixels, between the first vertex of the edge and the left border of the image. |
y1 | number | The distance, in pixels, between the first vertex of the edge and the top border of the image. |
x2 | number | The distance, in pixels, between the second vertex of the edge and the left border of the image. |
y2 | number | The distance, in pixels, between the second vertex of the edge and the top border of the image. |
type | string | Always |
description | string | An enum describing the position of the edge, which is one of::
|
{
...,
"response": {
"annotations": [
{
"label": "car",
"vertices": [
{
"description": "face-topleft",
"y": 270,
"x": 293,
"type": "vertex"
},
{
"description": "face-bottomleft",
"y": 437,
"x": 293,
"type": "vertex"
},
{
"description": "face-topright",
"y": 270,
"x": 471,
"type": "vertex"
},
{
"description": "face-bottomright",
"y": 437,
"x": 471,
"type": "vertex"
},
{
"description": "side-topcorner",
"y": 286,
"x": 607,
"type": "vertex"
},
{
"description": "side-bottomcorner",
"y": 373,
"x": 607,
"type": "vertex"
}
],
"edges": [
{
"description": "face-top",
"x1": 293,
"y1": 270,
"x2": 471,
"y2": 270,
"type": "edge"
},
{
"description": "face-right",
"x1": 471,
"y1": 270,
"x2": 471,
"y2": 437,
"type": "edge"
},
{
"description": "face-bottom",
"x1": 471,
"y1": 437,
"x2": 293,
"y2": 437,
"type": "edge"
},
{
"description": "face-left",
"x1": 293,
"y1": 437,
"x2": 293,
"y2": 270,
"type": "edge"
},
{
"description": "side-top",
"x1": 471,
"y1": 270,
"x2": 607,
"y2": 286,
"type": "edge"
},
{
"description": "side-bottom",
"x1": 471,
"y1": 437,
"x2": 607,
"y2": 373,
"type": "edge"
}
],
"points_2d": [
{
"y": 270,
"x": 293
},
{
"y": 437,
"x": 293
},
{
"y": 270,
"x": 471
},
{
"y": 437,
"x": 471
},
{
"y": 286,
"x": 607
},
{
"y": 373,
"x": 607
},
{
"y": 373,
"x": 607
},
{
"y": 373,
"x": 607
}
],
"points_3d": [
{
"z": 0,
"y": 270,
"x": 293
},
{
"z": 0,
"y": 437,
"x": 293
},
{
"z": 0,
"y": 270,
"x": 471
},
{
"z": 0,
"y": 437,
"x": 471
},
{
"z": 0,
"y": 286,
"x": 607
},
{
"z": 0,
"y": 373,
"x": 607
},
{
"z": 0,
"y": 373,
"x": 607
},
{
"z": 0,
"y": 373,
"x": 607
}
],
}
]
},
...
}