Object Detection API
Publish 2D object detections from your app. The SDK delivers them to the ground station, where they are drawn on top of the live video, and optionally to onboard consumers as well.

Available from Auterion SDK 1.27.0 and newer. This page assumes an app that already builds and runs on the vehicle: see Development environment Setup and Building your First App.
Quick start
runInference stands in for your detector: the example consumes a box center and size in source-image pixels, a class index, a score and a track id. Everything else is the whole API for the common case, and the rest of this page is detail. Camera selection and image access are covered by the Camera API.
Detections
Call updateDetections2D once per processed frame, including frames with no detections: that is how the overlay clears.
Every batch needs the four frame fields, and detectionsForImage fills all four from an SDK image so you never restate them:
frame_idties your boxes to the exact frame they came from. The video the operator sees may be cropped, zoomed or rotated further down the pipeline, and the SDK usesframe_idto place your boxes on it correctly.image_width/image_heightare required for the ground station, because boxes are normalized against the source image. A batch that passes 0 is skipped with a warning.
Boxes are in source-image pixels. If you run inference on a resized copy of the frame, map them back yourself: only you know whether the resize letterboxed, and the SDK does not guess.
Set track_id to the same value for the same object across frames if you track. The ground station keys its rendering by that id, so a stable id gives a box that follows the object. Leaving it unset is fine, the SDK fills in per-batch ids, but the overlay then has no identity between frames.
position_lla and velocity_ned are optional. Unset is transmitted as "unknown", not as zero.
The ground station draws every box labelled <class name> #<object id> <confidence>%; object id and confidence are always visible and cannot be suppressed. Only the highest-scoring hypothesis is shown.
Published detections can be selected for tracking: in tracking mode the operator taps a box and the tracker takes over that object, with nothing to implement in the detecting app. The operator workflow is described in Tracking a detected object. The selection reaches the tracking app through the Visual Tracking API.
Class names
Class ids go out exactly as you number them: nothing in the chain applies an offset, and the ground station resolves them against the catalog your app publishes.
Use ClassCatalog::fromClassIds({{1, "person"}, {4, "boat"}}) if your detector already numbers its classes. Without a catalog, hypothesis strings resolve numerically ("3" becomes class 3) and the ground station shows raw numbers. A class the SDK cannot resolve goes out as auterion::kUnknownClassId, so no ordinary class number is reserved and you can use 0.
After a model switch call provider.setClassCatalog(new_catalog) before publishing the first batch from the new model. It is safe to call while publishing.
Colour and category
ClassCatalog::fromEntries carries more than a name per class:
category selects how the ground station styles a class. It recognises friend, friendly, neutral and hostile (trimmed and lowercased) and draws any other value, including an unset one, in the default yellow. The derived colours are cyan for friend, green for neutral and red for hostile. A per-class color ("#RRGGBB") overrides the derived colour.
Stopping work when detection is off
Object detection can be requested to be switched off by other apps needing compute resources.
To poll instead, call subscribeObjectDetectionEnabled() without a callback, then read provider.objectDetectionEnabledSubscription().last(), guarded by isLastValid().
Output options
DetectionProviderOptions selects the channels and carries the catalog. Both channels are on by default, so an app that configures nothing already reaches on-board consumers and the ground station.
Any number of providers on one vehicle may enable the ROS output. At most one may enable the MAVLink output, because the ground station sees a single detection source: one catalog, one object-id space. A second detector alongside an existing one takes .withMavlink(false); two MAVLink providers give the operator interleaved, flickering boxes.
An integrator can flip either channel at launch through the parameter overrides object_detection_ros_output and object_detection_mavlink_output, without rebuilding the app.
The ROS output is vision_msgs/msg/Detection2DArray on object_detection/detections_2d, always in source-image pixels.
Last updated