# `BB.Message.Vision.Detections`
[🔗](https://github.com/beam-bots/bb_estimator_object_detection/blob/main/lib/bb/message/vision/detections.ex#L5)

The objects found in one camera frame.

A reading, like `BB.Message.Vision.Fiducials`: one message per frame
examined, whether or not anything was found. An empty `detections` list
says the detector looked and saw nothing.

The envelope is the frame's: `frame_id` is the camera that captured it, and
`monotonic_time` and `wall_time` are when it was captured rather than when
detection finished.

## Fields

- `detections` - one `BB.Message.Vision.Detections.Detection` per object,
  highest score first
- `width`, `height` - the dimensions of the frame, in pixels

Every box lies within the frame: `0.0 <= x1 <= x2 <= width` and
`0.0 <= y1 <= y2 <= height`. `c:BB.Message.validate/1` refuses a message
whose boxes don't, with `BB.Error.Invalid.Vision.BoxOutsideFrame`.

# `t`

```elixir
@type t() :: %BB.Message.Vision.Detections{
  detections: [BB.Message.Vision.Detections.Detection.t()],
  height: pos_integer(),
  width: pos_integer()
}
```

# `new`

```elixir
@spec new(atom(), keyword()) :: {:ok, BB.Message.t()} | {:error, term()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
