(image)
| 17 | |
| 18 | |
| 19 | def gaussian_noise(image): |
| 20 | noise = np.zeros(image.shape, image.dtype) |
| 21 | m = (15, 15, 15) |
| 22 | s = (30, 30, 30) |
| 23 | cv.randn(noise, m, s) |
| 24 | dst = cv.add(image, noise) |
| 25 | cv.imshow("gaussian noise", dst) |
| 26 | return dst |
| 27 | |
| 28 | |
| 29 | src = cv.imread("./test.png") |