In [4]:
# Let's first create a zero image with the same dimensions of the loaded image
image = cv2.imread('game_of_thrones_002_dragon.jpg')

gaussian_noise = np.zeros((image.shape[0], image.shape[1]),dtype=np.uint8)
cv2.imshow('All zero values',gaussian_noise)
cv2.waitKey()
Out[4]:
-1

Now, we can set the pixel values as a Gaussian noise. We have set a mean value to 128 and a standard deviation to 20.

In [5]:
cv2.randn(gaussian_noise, 128, 20)

cv2.imshow('Gaussian noise',gaussian_noise)
cv2.waitKey()
cv2.imwrite("Gaussian random noise.jpg",gaussian_noise)
Out[5]:
True