- mmcv.image.auto_contrast(img, cutoff=0)¶
Auto adjust image contrast.
This function maximize (normalize) image contrast by first removing cutoff percent of the lightest and darkest pixels from the histogram and remapping the image so that the darkest pixel becomes black (0), and the lightest becomes white (255).
img (ndarray) – Image to be contrasted. BGR order.
cutoff (int | float | tuple) – The cutoff percent of the lightest and darkest pixels to be removed. If given as tuple, it shall be (low, high). Otherwise, the single value will be used for both. Defaults to 0.
The contrasted image.
- Return type