Lines

Given a line entry in params.geometries, Scale will annotate your image or video with polylines (segmented lines) and return the vertices of the lines.

Request Parameters

ParameterTypeDefaultDescription
objects_to_annotatearray[]A list of string or LabelDescription objects.
min_verticesinteger1The minimum number of vertices in a valid line annotation for your request.
max_verticesintegernullThe maximum number of vertices in a valid line annotation for your request. Must be at least min_vertices.
{
  "geometries": {
    "line": {
      "objects_to_annotate": [
        "unmarked_lane",
        {
          "choice": "marked lanes",
          "subchoices": [
            "solid",
            {
              "choice": "dashed",
              "display": "dashed or dotted"
            }
          ]
        },
        "shoulder"
      ],
      "min_vertices": 2,
      "max_vertices": 15
    },
    ...
  },
  ...
}

Response Fields

KeyTypeDescription
uuidstringA computer-generated unique identifier for this annotation.

In video annotation tasks, this can be used to track the same object across frames.
typestringString to indicate geometry type: line
labelstringThe label of this annotation, chosen from the objects_to_annotate array for its geometry. In video annotation tasks, any annotation objects with the same uuid will have the same label across all frames.
attributesobjectSee the Annotation Attributes section for more details about the attributes response field.
verticesarrayAn array of vertex objects describing the vertices of the polygon, listed in the order they were annotated. In other words, the point order will be either clockwise or counter-clockwise for each annotation.

Definition: Vertex

KeyTypeDescription
xnumberThe distance, in pixels, between the vertex and the left border of the image.
ynumberThe distance, in pixels, between the vertex and the top border of the image.
{
  "response": {
    "annotations": [
      {
        "type": "line",
        "label": "solid line",
        "vertices": [
            {
                "x": 123,
                "y": 10
            },
            {
                "x": 140,
                "y": 49
            },
            {
                "x": 67,
                "y": 34
            }
        ],
        "uuid": "65ec1f52-5902-4b39-bea9-ab6b4d58ef42"
      },
      { ... },
      { ... }
    ]
  },
  "task_id": "5774cc78b01249ab09f089dd",
  "task": {
    // populated task for convenience
    ...
  }
}