equalize¶
- torchvision.transforms.functional.equalize(img: Tensor) Tensor [source]¶
通过将非线性映射应用于输入来均衡图像的直方图,以便在输出中创建灰度值的均匀分布。
- 参数:
img (PIL Image 或 Tensor) – 应用均衡化的图像。如果 img 是 torch Tensor,则应为 […, 1 或 3, H, W] 格式,其中 … 表示它可以具有任意数量的前导维度。张量 dtype 必须是
torch.uint8
,并且值应在[0, 255]
范围内。如果 img 是 PIL Image,则应为 “P”、“L” 或 “RGB” 模式。- 返回:
已均衡化的图像。
- 返回类型:
PIL Image 或 Tensor
使用
equalize
的示例