3
我試圖在一系列的照片做數據分析,當所有的照片都「改爲」從RGB到灰度,他們爲即將到來,以及看:rgb2gray不工作,創造彩虹圖像
The standard Astronaut image as my system says it's grayscale
下面是我使用的代碼:
import matplotlib.pyplot as plt
from skimage.color import rgb2gray
from skimage import data
img = data.astronaut()
img_gray = rgb2gray(img)
plt.imshow(img_gray)
plt.show()
我也試圖轉換爲HSV爲rgb然後灰度,但它仍然會產生相似的,非灰度圖像。