1、打开Python的shell界面,界面如图所示;

3、采用以下指令读取图片:img=data.coffee()

4、采用以下指令填产生噪声:rows,cols,dims=img.shapefor i in range(5000): 旌忭檀挢x=np.random.randint(0,rows) y=np.random.randint(0,cols) img[x,y,:]=255

6、查看的结果如下图所示。

时间:2024-10-12 07:14:39
1、打开Python的shell界面,界面如图所示;
3、采用以下指令读取图片:img=data.coffee()
4、采用以下指令填产生噪声:rows,cols,dims=img.shapefor i in range(5000): 旌忭檀挢x=np.random.randint(0,rows) y=np.random.randint(0,cols) img[x,y,:]=255
6、查看的结果如下图所示。