Monty.Frameworks.Models.Salience.Strategies.Vocus2.Pyramids.Pyramid (ExTbpMonty.Core v0.1.0)

Copy Markdown View Source

An image's scales, by octave and by blur.

Mirrors tbp/monty/frameworks/models/salience/strategies/vocus2/pyramids.py::Pyramid, a two-dimensional array of images: one row per octave (each half the resolution of the one above) and one column per scale (each more blurred than the one before). VOCUS2 compares a scale against its neighbours to find whatever is unlike its surroundings at that size, and a pyramid is how "that size" becomes an index.

Monty stores the planes in a numpy object array; here an octave is a list of planes and the pyramid is a list of octaves, so planes read pyramid.planes |> Enum.at(octave) |> Enum.at(scale).

A pyramid with no planes is an error: nothing downstream can tell an empty pyramid from an image with nothing in it.

Summary

Functions

Two pyramids added plane by plane.

The same pyramid with function applied to every plane.

Every plane, octave by octave and scale by scale.

How many octaves the pyramid holds.

How many scales each octave holds.

A pyramid of octaves, each a list of scales planes of the same shape.

How many octaves and how many scales: {octaves, scales}.

How many planes the pyramid holds.

Two pyramids subtracted plane by plane.

Types

plane()

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

t()

@type t() :: %Monty.Frameworks.Models.Salience.Strategies.Vocus2.Pyramids.Pyramid{
  planes: [[plane()]]
}

Functions

add(left, right)

@spec add(t(), t()) :: t()

Two pyramids added plane by plane.

apply(pyramid, function)

@spec apply(t(), (plane() -> plane())) :: t()

The same pyramid with function applied to every plane.

flat(pyramid)

@spec flat(t()) :: [plane()]

Every plane, octave by octave and scale by scale.

n_octaves(pyramid)

@spec n_octaves(t()) :: pos_integer()

How many octaves the pyramid holds.

n_scales(pyramid)

@spec n_scales(t()) :: pos_integer()

How many scales each octave holds.

new(planes)

@spec new([[plane()]]) :: t()

A pyramid of octaves, each a list of scales planes of the same shape.

shape(pyramid)

@spec shape(t()) :: {pos_integer(), pos_integer()}

How many octaves and how many scales: {octaves, scales}.

size(pyramid)

@spec size(t()) :: pos_integer()

How many planes the pyramid holds.

subtract(left, right)

@spec subtract(t(), t()) :: t()

Two pyramids subtracted plane by plane.