adjust_contrast¶
- torchvision.transforms.functional.adjust_contrast(img: Tensor, contrast_factor: float) Tensor[原始碼]¶
調整影像的對比度。
- 引數:
img (PIL Image 或 Tensor) – 要調整的影像。如果 img 是 torch Tensor,則預期格式為 […, 1 或 3, H, W],其中 … 表示它可以有任意數量的前導維度。
contrast_factor (float) – 對比度的調整量。可以是任何非負數。0 表示全灰影像,1 表示原始影像,而 2 表示將對比度增加一倍。
- 返回:
對比度調整後的影像。
- 返回型別:
PIL Image 或 Tensor