How to add Rician noise to an image?

23 次查看(过去 30 天)
JayD
JayD 2015-12-3
编辑: DGM 2023-4-9
Hi, I am simulating some MR images for my project. I am not sure about adding image to each real and imaginary channel. OR should it be the projection of image to each channel? Can anyone please verify or give a proper method? So far I did this,
N = 10; % changing N can control SNR
Ii = randn(256)*N + img; % imaginary channel
Ir = randn(256)*N + img; % real channel
noisyimage = sqrt(Ii.^2 + Ir.^2);

回答(3 个)

JayD
JayD 2015-12-14
I figured out how to add rician noise to an image and share it with those who are interested. Let image be 256x256 matrix, the image we want to add rician noise.
realchannel = normrnd(0,N,256,256) + image; % N is the gaussian noise level
imaginarychannel = normrnd(0,N,256,256);
noisyimage = sqrt(realchannel.^2 + imaginarychannel.^2); % now the image has Rician distributed noise.
  1 个评论
Image Analyst
Image Analyst 2015-12-14
Why are you calling them real and imaginary? There are no imaginary or complex variables there. All your variables are real. Simply calling it imaginarychannel does not make it imaginary, obviously.

请先登录,再进行评论。


Mehri Mehrnia
Mehri Mehrnia 2023-4-8
移动:DGM 2023-4-8
what you have done looks wrong for me. if you ignore imaginary part of image then noisy image is same as original one.

DGM
DGM 2023-4-8
编辑:DGM 2023-4-9
I don't have a reference to test against, but just looking around it seems right. I'm assuming that the goal is to literally treat it as additive noise as one would do with Gaussian noise. I'm not familiar with the application, so this is my assumption.
% parameters (assuming image data is unit-scale)
v = 0.1;
sg = 0.1;
% get an image
inpict = imread('cameraman.tif');
% generate the noise
sz = size(inpict);
noise = v/sqrt(2) + sg*randn([prod(sz) 2]); % bivariate normal RN
noise = sqrt(sum(noise.^2,2)); % magnitude
noise = reshape(noise,sz); % reshape to match the image
% add noise to image
outpict = im2double(inpict) + noise;
imshow(outpict)
EDIT: It does seem to check fine against randraw('rice',...), so I'm going to assume it's correct.
EDIT AGAIN: According to this, I'm wrong. The noise isn't additive. The signal is the distance vector V. So then we have this:
% parameters (assuming image data is unit-scale)
sg = 0.05;
% get an image
inpict = imread('cameraman.tif');
% generate the noise
sz = size(inpict);
noise = sg*randn([prod(sz) 2]); % bivariate zero-mean normal RN
noise(:,1) = noise(:,1) + im2double(inpict(:)); % signal is distance vector
noise = sqrt(sum(noise.^2,2)); % magnitude
% reshape to match the input
outpict = reshape(noise,sz);
imshow(outpict)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by