mmcv.image.auto_contrast¶
- 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.
- 返回类型
ndarray