(image, mean=0.1, sigma=0.35)
| 60 | |
| 61 | |
| 62 | def random_gaussian(image, mean=0.1, sigma=0.35): |
| 63 | def gaussianNoisy(im, mean=mean, sigma=sigma): |
| 64 | for _i in range(len(im)): |
| 65 | im[_i] += random.gauss(mean, sigma) |
| 66 | return im |
| 67 | |
| 68 | img = np.asarray(image) |
| 69 | width, height = img.shape |
| 70 | img = gaussianNoisy(img[:].flatten(), mean, sigma) |
| 71 | img = img.reshape([width, height]) |
| 72 | return Image.fromarray(np.uint8(img)) |
| 73 | |
| 74 | |
| 75 | def random_pepper(img, N=0.0015): |
nothing calls this directly
no test coverage detected