How to add Rician noise to an image?

조회 수: 21 (최근 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