How can i determine the percentage of noise given the variance of imnoise ??

8 ビュー (過去 30 日間)
Mariem Harmassi
Mariem Harmassi 2012 年 10 月 19 日
using the noise function J = imnoise(I,'gaussian',m,v) ,how can i estimate the percentage of noise ????
  5 件のコメント
Mariem Harmassi
Mariem Harmassi 2012 年 10 月 20 日
i am asking how can i calculate the percentage of noise for a mean and varience given ?? Is there any method able to estimate the percentage of noise for the code J = imnoise(I,'gaussian',m,v) Or the inverse given a percentage of noise ,How can i determine the appropriates variance and mean . The goal is to have the relation between the (m,v) and the percentage of noise.
Image Analyst
Image Analyst 2012 年 10 月 20 日
Did you ever see my answer below?

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

採用された回答

Image Analyst
Image Analyst 2012 年 10 月 20 日
編集済み: Image Analyst 2012 年 10 月 20 日
From the help:
J = imnoise(I,'gaussian',m,v) adds Gaussian white noise of mean m and variance v to the image I. The default is zero mean noise with 0.01 variance.
Let's get the mean of the entire image
meanOfI = mean2(I);
So, on average, I think you're saying you want sqrt(variance) to equal 40% of meanOfI. So now you know what v has to be. Try experimenting around a bit and see what you learn.
Perhaps this demo will be instructive:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
imtool close all; % Close all imtool figures.
clear; % Erase all existing variables.
workspace; % Make sure the workspace panel is showing.
format longg;
format compact;
fontSize = 14;
% Get the original image.
grayImage = imread('eight.tif');
subplot(2, 2, 1);
imshow(grayImage);
title('Original Gray Scale Image', 'FontSize', fontSize);
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
% Add Gaussian noise to the pixel values.
noisyImage = imnoise(grayImage,'gaussian', 0, 0.02);
subplot(2, 2, 2);
imshow(noisyImage, []);
title('Noisy Image', 'FontSize', fontSize);
% Get the noise alone.
noiseOnly = single(noisyImage) - single(grayImage);
subplot(2, 2, 3);
imshow(noiseOnly, []);
title('Image of Only the Noise', 'FontSize', fontSize);
% Calculate the signal to noise ratio
snrImage = abs(noiseOnly) ./ double(grayImage);
subplot(2, 2, 4);
imshow(snrImage, []);
title('Image of the Signal-to-Noise Ratio', 'FontSize', fontSize);
% Get the mean SNR
snrMean = mean2(snrImage);
message = sprintf('The mean Signal-to-Noise Ratio = %.2f', snrMean);
uiwait(msgbox(message));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeExplore and Edit Images with Image Viewer App についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by