Monty.Frameworks.Models.Salience.Strategies.Vocus2.Images.ColorSpaceConverter behaviour (ExTbpMonty.Core v0.1.0)

Copy Markdown View Source

How a salience strategy turns the camera's colour image into the channels it reasons about.

Mirrors tbp/monty/frameworks/models/salience/strategies/vocus2/images.py::ColorSpaceConverter, a Protocol in Monty, so a strategy can name any function with this shape. It is a behaviour here: an RGB image in, a float image out, one channel or several, shifted and scaled so that [0, 1] is the whole range.

Monty's three converters — rgb_to_lab/1, rgb_to_opponent/1 and rgb_to_opponent_codi/1 — are plain functions in the module beside this one and are not instances of the protocol; they match its shape, which is all either needs.

Summary

Types

An RGB image: rows of pixels, each three channels, 0..255 as read.

t()

Callbacks

The image in the converter's colour space.

Types

rgb()

@type rgb() :: [[[float()]]]

An RGB image: rows of pixels, each three channels, 0..255 as read.

t()

@type t() :: struct()

Callbacks

call(t, rgb)

@callback call(t(), rgb()) :: [[[float()]]]

The image in the converter's colour space.