autocontrast¶
- torchvision.transforms.functional.autocontrast(img: Tensor) Tensor [source]¶
通过按通道重新映射像素来最大化图像对比度,使最低值变为黑色,最高值变为白色。
- 参数:
img (PIL Image 或 Tensor) – 应用自动对比度的图像。如果 img 是 torch Tensor,则预期格式为 […, 1 或 3, H, W],其中 … 表示它可以具有任意数量的前导维度。如果 img 是 PIL Image,则预期模式为“L”或“RGB”。
- 返回值:
经过自动对比度调整的图像。
- 返回类型:
PIL Image 或 Tensor
使用
autocontrast
的示例