Units

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

Classes:

Rescale([in_range, out_range, clip])

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: 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

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: 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.HSV: 1>: {   <Colorspaces.RGB: 2>: <function hsv_to_rgb at 0x7f4a15a913a0>},     <Colorspaces.RGB: 2>: {   <Colorspaces.HSV: 1>: <function rgb_to_hsv at 0x7f4a15a91310>,                               <Colorspaces.YIQ: 3>: <function rgb_to_yiq at 0x7f4a15bc4d30>,                               <Colorspaces.HLS: 4>: <function rgb_to_hls at 0x7f4a15a91160>},     <Colorspaces.YIQ: 3>: {   <Colorspaces.RGB: 2>: <function yiq_to_rgb at 0x7f4a15a910d0>},     <Colorspaces.HLS: 4>: {   <Colorspaces.RGB: 2>: <function hls_to_rgb at 0x7f4a15a911f0>}}
process(input, *args)[source]