morphoclass.transforms.augmentors.random_jitter module¶
Implementation of the RandomJitter transform.
-
class
morphoclass.transforms.augmentors.random_jitter.RandomJitter(d_add=0.0, d_scale=0.0, shift_to_origin=True)¶ Bases:
objectRandomly jitter all nodes.
The jittering is applied in the following way. For each coordinate x draw two random numbers, d1 in {-d_add, +d_add} and d2 in {-d_scale, +d_scale} and transform x as follows:
x => (x + d1) * (1 + d2)
Note that d_scale is the scale variation relative to 1.0.
- Parameters
d_add (float) – The maximal additive factor for jittering.
d_scale (float) – The maximal multiplicative factor for jittering (relative to 1.0).
shift_to_origin (bool (optional)) – If true then make sure that the root point is at the origin before and after the transformation.