ObjectDetector

Produces labeled object detections from camera frames.

#include <object_detector.hpp>

Classes

class ObjectDetector

Object Detection feature of the perception service.

Owned by PerceptionController. Obtain via `vehicle.GetPerceptionController().GetObjectDetector()`.

Threading: snapshot reads are safe from any thread. Scene callback fires on the detection pipeline's thread.

bool IsAvailable() const

True iff at least one sensor with `kImagery` capability is attached and a detection pipeline is initialized.

Returns false when the active camera does not expose frames for detection, or when detection support is not built into this SDK.

Returns: bool

Scene GetLatestScene() const

Returns the latest fully-described scene (objects and free-space hints).

Returns: Latest Scene snapshot; empty if no detection has been produced yet.

std::vector<DetectedObject> GetLatestDetections() const

Returns the object list from the latest scene.

Returns: Vector of detected objects; empty if none available.

void SetLabelFilter(std::vector<std::string> labels)

Only fire callbacks / surface detections whose label is in `labels`. Empty vector means "all labels" (default).

Filtering applies to async callbacks and to GetLatestDetections / GetLatestScene results.

ParameterTypeDescription
labels std::vector<std::string>
const std::vector<std::string>& GetLabelFilter() const

Returns the current label filter.

Returns: Filter list; empty vector means all labels are accepted.

void OnSceneUpdated(SceneCallback cb)

Register a callback that fires whenever a new scene is produced. Pass an empty callback to clear.

ParameterTypeDescription
cb SceneCallback