Scale¶
-
menpo.transform.Scale(scale_factor, n_dims=None)[source]¶ Factory function for producing Scale transforms. Zero scale factors are not permitted.
A
UniformScalewill be produced if:A float
scale_factorand an_dimskwarg are providedA ndarray
scale_factorwith shape(n_dims,)is provided with all elements being the same
A
NonUniformScalewill be provided if:A ndarray
scale_factorwith shape(n_dims,)is provided with at least two differing scale factors.
- Parameters
scale_factor (float or
(n_dims,)ndarray) – Scale for each axis.n_dims (int, optional) – The dimensionality of the output transform.
- Returns
scale (
UniformScaleorNonUniformScale) – The correct type of scale- Raises
ValueError – If any of the scale factors is zero