用python程序处理图像文件“chenchen.jpg”,该图像颜色位深度为24bit,图像如图所示:
![](http://tikupic.21cnjy.com/2024/05/30/d2/f8/d2f8bee2329f408582bfe01511fce5e0.png)
程序代码如下:
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()
下列说法正确的是( )