autocontrast¶
- torchvision.transforms.functional.autocontrast(img: Tensor) Tensor [源代码]¶
通过重新映射每个通道的像素,将最低值映射为黑色,最高值映射为白色,从而最大化图像对比度。
- 参数:
img (PIL Image 或 Tensor) – 应用自动对比度的图像。如果 img 是 torch Tensor,则它应为 […, 1 或 3, H, W] 格式,其中 … 表示可以有任意数量的前导维度。如果 img 是 PIL Image,则它应为“L”或“RGB”模式。
- 返回:
已进行自动对比度处理的图像。
- 返回类型:
PIL 图像或张量
使用
autocontrast
的示例