How can i resolve this error?

1 回表示 (過去 30 日間)
Syed Zenith Rhyhan
Syed Zenith Rhyhan 2018 年 9 月 15 日
編集済み: KALYAN ACHARJYA 2018 年 9 月 15 日
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables.
% workspace; % Make sure the workspace panel is showing.
fontSize = 22;
%Load single MRI image
I = imread('blood.jpg');
% addition of graininess (i.e. noise)
I_noise = imnoise(I, 'gaussian', 0.09);
% the average of 3^2, or 9 values(filters the multidimensional array A with the multidimensional filter h)
h = ones(3,3) / 3^2;
I2 = wiener2(I_noise,h);
% Measure signal-to-noise ratio
img=I;
img=double(img(:));
ima=max(img(:));
imi=min(img(:));
mse=std(img(:));
snr=20*log10((ima-imi)./mse)
% Measure Peak SNR
[peaksnr, snr] = psnr(I_noise, I);
fprintf('\n The Peak-SNR value is %0.4f', peaksnr);
fprintf('\n The SNR value is %0.4f \n', snr);
fprintf('\n The MSE value is %0.4f \n', mse);
%Plot original & filtered figure
subplot(1,2,1), imshow(I_noise), title('Original image')
subplot(1,2,2), imshow(I2), title('Filtered image')
text(size(I,2),size(I,1)+15, ...
'Gaussian = 0.09', ...
'FontSize',10,'HorizontalAlignment','right');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Error occured:%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error in wiener2 (line 38) [g, nhood, noise] = ParseInputs(varargin{:});
Error in ps (line 12) I2 = wiener2(I_noise,h);
  1 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 9 月 15 日
編集済み: KALYAN ACHARJYA 2018 年 9 月 15 日
Have you resolved it?Where is the error? Can you share?

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

採用された回答

ahmed nebli
ahmed nebli 2018 年 9 月 15 日
u need to go back to wiener2 function and see how much variable u need, i think you forgot a variable

その他の回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 9 月 15 日
編集済み: KALYAN ACHARJYA 2018 年 9 月 15 日
% Have you check here the format of Wiener filter
I2=wiener2(image,[m n]);
% Here [m n] specifies the size (m-by-n) of the neighborhood used to estimate the local image mean and standard deviation.
Here you h is
2nd Case: Covert the blood.jpg to gray, then do the rest of operations
  3 件のコメント
Syed Zenith Rhyhan
Syed Zenith Rhyhan 2018 年 9 月 15 日
Thanks a lot sir for your feedback.Now the program working correctly.
KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 9 月 15 日
編集済み: KALYAN ACHARJYA 2018 年 9 月 15 日
OK

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

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by