[iapad] [Up] [iaind2sub] | Image Information and Manipulation |
Implemented in Python.
g | Image. Gray-scale (uint8 or uint16) or binary image (logical). |
>>> f=[[1,2],[3,4]]
>>> print f
[[1, 2], [3, 4]]
>>> g = iatile(f, (3,6))
>>> print g
[[1 2 1 2 1 2] [3 4 3 4 3 4] [1 2 1 2 1 2]]
def iatile(f, new_size): from Numeric import asarray, NewAxis, resize, transpose f = asarray(f) if len(f.shape) == 1: f = f[NewAxis,:] aux = resize(f, (new_size[0], f.shape[1])) aux = transpose(aux) aux = resize(aux, (new_size[1], new_size[0])) g = transpose(aux) return g
[iapad] [Up] [iaind2sub] | |