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的示例