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