def __init__(self, output_image_shape, interpolation_order=3, zoom_kwargs=None, **super_kwargs):
"""
Parameters
----------
output_image_shape : list or tuple or int
Target size of the output image. Aspect ratio may not be preserved.
interpolation_order : int
Interpolation order for the spline interpolation.
zoom_kwargs : dict
Keyword arguments for `scipy.ndimage.zoom`.
super_kwargs : dict
Keyword arguments for the superclass.
"""
super(Scale, self).__init__(**super_kwargs)
output_image_shape = (output_image_shape, output_image_shape) \
if isinstance(output_image_shape, int) else tuple(output_image_shape)
assert_(len(output_image_shape) == 2,
"`output_image_shape` must be an integer or a tuple of length 2.",
ValueError)
self.output_image_shape = output_image_shape
self.interpolation_order = interpolation_order
self.zoom_kwargs = {} if zoom_kwargs is None else dict(zoom_kwargs)
评论列表
文章目录