フィルターのクリア

Non-zero Gaussian noise in image processing

5 ビュー (過去 30 日間)
Elyazeya Almur
Elyazeya Almur 2021 年 4 月 26 日
コメント済み: DGM 2024 年 6 月 4 日
How can i Generate Gaussian Noise with a non zero meadian?
i found this code put i do not understand the division by 256.
where (I) is the cameraman image.
%Generating Gaussian Noise
mean= 40/256; Std= 20; var=(Std/256)^2;
G=imnoise(I,'gaussian',mean,var);
imshow(G)
title ('Image with Gaussian Noise')
  1 件のコメント
DGM
DGM 2024 年 6 月 4 日
The parameter inputs to imnoise() are expected to be in unit-scale (0 to 1), regardless of the class of the input image. Consequently, if you specify your parameters in uint8-scale (0 to 255) for no good reason, you'll have to normalize them by dividing by 255, not 256.
The whole point is that the parameter scale is independent of the class of the image. Unless they're being derived from uint8-scale data (and they plainly are not), I see no reason for them to be in uint8-scale, or any scale presumptive of the image class. Just specify them in unit-scale, as imnoise() expects.
% parameters in unit-scale
mu = 0.157;
sig = 0.078;
% the image
inpict = imread('cameraman.tif');
% the image with noise
outpict = imnoise(inpict,'gaussian',mu,sig^2);
imshow(outpict)
title ('Image with Gaussian Noise')

サインインしてコメントする。

回答 (1 件)

Matt J
Matt J 2021 年 4 月 26 日
As an example,
mu=0.1;sigma=0.3;
J = imnoise(imread('cameraman.tif'),'gaussian',mu,sigma^2);
imshow(J)

Community Treasure Hunt

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

Start Hunting!

Translated by