mindspore/docs/api/api_python/dataset_vision/mindspore.dataset.vision.Gr...

14 lines
539 B
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.dataset.vision.Grayscale
==================================
.. py:class:: mindspore.dataset.vision.Grayscale(num_output_channels=1)
将输入PIL图像转换为灰度图。
参数:
- **num_output_channels** (int) - 输出灰度图的通道数取值可为1或3。当取值为3时返回图像各通道的像素值将相同。默认值1。
异常:
- **TypeError** - 当 `num_output_channels` 的类型不为int。
- **ValueError** - 当 `num_output_channels` 取值不为1或3。