用python程序处理图像文件“chenchen.jpg”,该图像颜色位深度为24bit,图像如图所示:
程序代码如下:
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
img=np.array(Image.open("chenchen.jpg").convert("L"))
rows,cols=img.shape
for i in range(rows):
for j in range(cols):
if():
img[i,j]=1
else:
img[i,j]=0
plt.imshow(img,cmap="gray")
plt.show()
下列说法正确的是( )