adjust_gamma¶
- torchvision.transforms.functional.adjust_gamma(img: Tensor, gamma: float, gain: float = 1) Tensor [來源]¶
對影像執行伽瑪校正。
也稱為冪律轉換。RGB 模式中的強度根據以下方程式進行調整
\[I_{\text{out}} = 255 \times \text{gain} \times \left(\frac{I_{\text{in}}}{255}\right)^{\gamma}\]請參閱 伽瑪校正 以取得更多詳細資訊。
- 參數:
- 傳回:
伽瑪校正調整後的影像。
- 傳回類型:
PIL Image 或 Tensor