norm_ab

imagepypelines.norm_ab(img, a, b)[source]

Normalize img to the range [a, b], inclusive. Float output by default.

If a < b, then the histogram will just be scaled and shifted. If b > a, then the histogram will be flipped left-right, scaled, and shifted.

Parameters:
  • img (np.ndarray) – image to normalize, can be any dtype.
  • a (float) – one end of range
  • b (float) – other end of range
Returns:

normalized image, dtype=np.float64

Return type:

np.ndarray