Skip to content

Documentation for Warping Controller

WarpController

This class wraps the WarpTransform subclasses by making them an object of this class. The distortion levels are mapped to a given range of strengths for each warp to allow a common interface across all warping transformations.

Parameters:

Name Type Description Default
warp_transform WarpTransform

The particular warping class that we want a controller over. Example: Fisheye, Swirl.

required
max_distortion_level int

The maximum distortion level possible for this warping controller. Should be >= 0. When max_distortion_level is not passed with a range, the strength range is hard-coded and the max_distortion_level is used to determine how many samples to get from this range.

10
strength_range A tuple of floats or a tuple of ints

The minimum/identity warping strength and the maximum warping strength for a transformation. We uniformly sample max_distortion_level+1 levels from this range.

None

Examples:

>>> SwirlController = WarpController(Swirl, 5, (0, 1))
>>> swirl_transformer = SwirlController(1, radius=1)

The args following distortion_level need to be keyword arguments.

__call__

__call__(distortion_level=0, **kwargs)

Parameters:

Name Type Description Default
distortion_level int

The distortion effect from 0 to max_distortion_level. 0 for identify function, max_distortion_level for max distortion as defined in the mapping function.

0

Returns:

Type Description
WarpTransform

The initialized object of WarpTransform with the given distortion level and keyword arguments.