如何使用Python通过numpy ,Image,matplotlib实现以下图形效果

不懂如何通过numpy的random函数将左侧的红色通道进行随机模糊操作,求指点

img

img

我的理解,是用random函数将RGB随便哪个通道的数值替换成0到255的随机数。在你的代码基础上试试:

for i in range(380):
    for j in range(335):
        ar1[i,j,0]=np.random.randint(0,255)

img


供你参考
又拿原图测试了一下:

img