scipy.datasets.

ascent#

scipy.datasets.ascent()[源代码]#

获取一个 8 位灰度位深、512 x 512 派生图像,方便用于演示。

该图像来源于 https://pixnio.com/people/accent-to-the-top

参数:
None
返回:
ascentndarray

方便的图像,用于测试和演示

附注

数组 API 标准支持

ascent 不在 Python 数组 API 标准兼容后端(NumPy 除外)的支持范围内。

有关更多信息,请参阅 对数组 API 标准的支持

示例

>>> import scipy.datasets
>>> ascent = scipy.datasets.ascent()
>>> ascent.shape
(512, 512)
>>> ascent.max()
np.uint8(255)
>>> import matplotlib.pyplot as plt
>>> plt.gray()
>>> plt.imshow(ascent)
>>> plt.show()
../../_images/scipy-datasets-ascent-1.png