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