solarize¶
- torchvision.transforms.functional.solarize(img: Tensor, threshold: float) Tensor[source]¶
透過反轉高於閾值的所有畫素值來對 RGB/灰度影像進行曝光過度處理 (solarize)。
- 引數:
img (PIL Image 或 Tensor) – 需要進行顏色反轉的影像。如果 img 是 torch Tensor,則期望其格式為 […, 1 或 3, H, W],其中 … 表示可以有任意數量的前導維度。如果 img 是 PIL Image,則期望其模式為 “L” 或 “RGB”。
threshold (float) – 所有等於或高於此值的畫素將被反轉。
- 返回:
經過曝光過度處理的影像。
- 返回型別:
PIL Image 或 Tensor
使用
solarize的示例