1

This is what I have tried so far, this is the output:

from scipy.stats import rice

rice.rvs(img)
J French
  • 187
  • 7

1 Answers1

2

Rician noise can most easily be generated by taking the magnitude of a bivariate normal distribution.

import numpy as np

# Parameters of Rician noise
v = 8
s = 5
N = 100  # how many samples

noise = np.random.normal(scale=s, size=(N, 2)) + [[v,0]]
noise = np.linalg.norm(noise, axis=1)

To add this noise to an image img, set N = img.size, generate the noise, and then

img += noise.reshape(img.shape)
Cris Luengo
  • 55,762
  • 10
  • 62
  • 120