# `Monty.Frameworks.Models.Salience.OnObjectObservation`
[🔗](https://github.com/d-led/ex.tbp.monty/blob/v0.1.0/packages/ex_tbp_monty_core/lib/monty/frameworks/models/salience/on_object_observation.ex#L1)

A view, reshaped so that every array is addressed by pixel.

Mirrors
`tbp/monty/frameworks/models/salience/on_object_observation.py::OnObjectObservation`
and its function of the same name. A raw observation arrives as an image and a
flat list of points — one row per pixel, three coordinates and a semantic id —
and a salience module wants them all as grids: where each pixel is in the
world, which pixels are on the object, and how interesting those pixels are.
That reshaping is this, once, rather than in each strategy.

The middle pixel is the one `width * half + half` of the flat point cloud, as
Monty indexes it: `location_map[row][column]` is the row the transform left for
that pixel.

## Where the semantic mask comes from

Monty reads the mask from the flat `semantic_3d` array's fourth column, not
from the depth image, so a pixel that returned a depth but is not on an object
counts as background — the difference that makes a surface agent's search look
at its object rather than at the scenery.

# `location`

```elixir
@type location() :: [float()]
```

# `location_map`

```elixir
@type location_map() :: [[location()]]
```

# `mask`

```elixir
@type mask() :: [[boolean()]]
```

# `t`

```elixir
@type t() :: %Monty.Frameworks.Models.Salience.OnObjectObservation{
  centre_location: location() | nil,
  location_map: location_map(),
  locations: [location()],
  on_object_map: mask(),
  salience: [float()]
}
```

# `from`

```elixir
@spec from(map(), [[float()]]) :: t()
```

The view's pixels, as grids: the on-object mask, the location map, and the
on-object locations and salience values in the order Monty collects them —
row by row, left to right.

---

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