def normalize(img, min_value=0, max_value=255):
    """ Normalizes input image between min_value and max_value."""
    return (min_value + (img - img.min()) * (max_value - min_value) /
            (img.max() - img.min()))