使用PIL库的Image模块,我们可以通过调用 getdata() 方法来获取图像的像素值,并将其转换为NumPy数组。 pixels = np.array(img.getdata()).reshape(img.
確定! 回上一頁