adjust_contrast¶
- torchvision.transforms.functional.adjust_contrast(img: Tensor, contrast_factor: float) Tensor[原始碼]¶
調整影像的對比度。
- 引數:
img (PIL Image or Tensor) – Image to be adjusted. If img is torch Tensor, it is expected to be in […, 1 or 3, H, W] format, where … means it can have an arbitrary number of leading dimensions.
contrast_factor (float) – 對比度調整的程度。可以是任何非負數。0 會得到一個實心的灰色影像,1 會得到原始影像,而 2 會將對比度提高一倍。
- 返回:
對比度調整後的影像。
- 返回型別:
PIL 影像或張量