numpy库的一些函数

    科技2025-02-08  15

    1. numpy.linspace
    numpy.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None) 在指定的间隔范围内返回均匀间隔的数字。在[start, stop]范围内计算,返回num个(默认为50)均匀间隔的样本。


    2. img.shape

    可以访问图像的形状。 它返回一组行,列和通道的元组(如果图像是彩色的):

    >>> print img.shape (342, 548, 3) 如果图像是灰度,则返回的元组仅包含行数和列数。因此,检查加载的图像是灰度还是彩色图像是一种很好的方法。
    3.
    Processed: 0.010, SQL: 8