Units

For converting between things that are the same thing but have different numbers and shapes

Classes:

Rescale(in_range, float] =, out_range, float] =)

Rescale values from one range to another

Colorspaces(value)

An enumeration.

Color(convert_from, convert_to[, output_scale])

Convert colors using the colorsys module!!

class Rescale(in_range: Tuple[float, float] = (0, 1), out_range: Tuple[float, float] = (0, 1), clip=False, *args, **kwargs)[source]

Bases: autopilot.transform.transforms.Transform

Rescale values from one range to another

Attributes:

format_in

format_out

Methods:

process(input)

Subtract input minimum, multiple by output/input size ratio, add output minimum

format_in = { 'type': ( <class 'numpy.ndarray'>, <class 'float'>, <class 'int'>, <class 'tuple'>, <class 'list'>)}
format_out = {'type': <class 'numpy.ndarray'>}
process(input)[source]

Subtract input minimum, multiple by output/input size ratio, add output minimum

class Colorspaces(value)[source]

Bases: enum.Enum

An enumeration.

Attributes:

HSV

RGB

YIQ

HLS

HSV = 1
RGB = 2
YIQ = 3
HLS = 4
class Color(convert_from: autopilot.transform.units.Colorspaces = <Colorspaces.HSV: 1>, convert_to: autopilot.transform.units.Colorspaces = <Colorspaces.RGB: 2>, output_scale=255, *args, **kwargs)[source]

Bases: autopilot.transform.transforms.Transform

Convert colors using the colorsys module!!

Note

All inputs must be scaled (0,1) and all outputs will be (0,1)

Attributes:

format_in

format_out

CONVERSIONS

Methods:

process(input, *args)

format_in = {'type': <class 'tuple'>}
format_out = {'type': <class 'tuple'>}
CONVERSIONS = { <Colorspaces.RGB: 2>: { <Colorspaces.HSV: 1>: <function rgb_to_hsv at 0x7fc46dbd9ef0>, <Colorspaces.YIQ: 3>: <function rgb_to_yiq at 0x7fc46dbd95f0>, <Colorspaces.HLS: 4>: <function rgb_to_hls at 0x7fc46dbd9d40>}, <Colorspaces.HSV: 1>: { <Colorspaces.RGB: 2>: <function hsv_to_rgb at 0x7fc46dbd9f80>}, <Colorspaces.YIQ: 3>: { <Colorspaces.RGB: 2>: <function yiq_to_rgb at 0x7fc46dbd9560>}, <Colorspaces.HLS: 4>: { <Colorspaces.RGB: 2>: <function hls_to_rgb at 0x7fc46dbd9dd0>}}
process(input, *args)[source]