def preserve_shape(func):
@wraps(func)<EOL>def wrapped_function(img, *args, **kwargs):<EOL><INDENT>shape = img.shape<EOL>result = func(img, *args, **kwargs)<EOL>result = result.reshape(shape)<EOL>return result<EOL><DEDENT>return wrapped_function<EOL>
Preserve shape of the image.