椒盐噪声(简单实现)
def noise(image, n10000):result image.copy()length, high result.shape[:2]for i in range(n):# 根据随机值来指定x, y位置x np.random.randint(1, length)y np.random.randint(1, high)# 改变x, y位置的值if np.random.randint(2) 0: # 取值为0或1result[x, y] 255e…
2025-01-13