2024-heraklion-testing-debu.../extra_slides/packaging/noiser_project_final/noiser/noise.py

8 lines
171 B
Python
Raw Normal View History

2024-08-26 13:54:13 +02:00
import numpy as np
def white_noise(image, std):
noise = np.random.normal(scale=std, size=image.shape).astype(image.dtype)
noisy = image + noise
return noisy