all_to_uniform

all_to_uniform(im, scale=None)[source]

Take an image with some distribution of greyscale values and convert it to a uniform (i.e. flat) distribution.

Parameters:
  • im (ndarray) – The image with the greyscale values distribution to be converted.

  • scale ([low, high]) – A list or array indicating the lower and upper bounds for the new randomly distributed data. The default is None, which uses the max and min of the original image as the the lower and upper bounds, but another common option might be [0, 1].

Returns:

image – A copy of im with uniformly distributed greyscale values spanning the specified range, if given.

Return type:

ndarray

Examples

Click here to view online example.