This is what I have tried so far, this is the output:
from scipy.stats import rice
rice.rvs(img)
This is what I have tried so far, this is the output:
from scipy.stats import rice
rice.rvs(img)
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)