What will be the solution of the following error?

6 ビュー (過去 30 日間)
Syed Zenith Rhyhan
Syed Zenith Rhyhan 2018 年 9 月 21 日
編集済み: Walter Roberson 2018 年 9 月 21 日
%%Matlab 2014a%%
clc;
clear all;
close all;
a=imread('blood.jpg');
A=imnoise(a,'gaussian',0.01);
figure;
subplot(1,2,1);imshow(a);
subplot(1,2,2);imshow(A);
sigma=3;
cutoff=ceil(3*sigma);
h=fspecial('gaussian',2*cutoff+1,sigma);
out=conv(a,h,'same');
figure,imshow(out);
figure,imshow(out/256);
out1=conv(A,h,'same');
figure,imshow(out1/256);
w=wiener2(A,[3 3]);
figure,imshow(w);
surf(1:2*cutoff+1,1:2*cutoff+1,h)
%%%%Error%%%%
Error using conv (line 26)
A and B must be vectors.
Error in gnf (line 13)
out=conv(a,h,'same');

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 9 月 21 日
編集済み: KALYAN ACHARJYA 2018 年 9 月 21 日
a=rgb2gray(imread('blood.jpg'));
A=imnoise(a,'gaussian',0.01);
figure; subplot(1,2,1);imshow(a);
subplot(1,2,2);imshow(A);
sigma=3;
cutoff=ceil(3*sigma);
h=fspecial('gaussian',2*cutoff+1,sigma);
out=conv2(a,h,'same');
figure,imshow(out);
figure,imshow(out/256);
out1=conv2(A,h,'same');
figure,imshow(out1/256);
w=wiener2(A,[3 3]);
figure,imshow(w);
surf(1:2*cutoff+1,1:2*cutoff+1,h);
  3 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 9 月 21 日
Thanks, Please read the answer comments of @walter sir.
You can convert to double and do the operation.
Syed Zenith Rhyhan
Syed Zenith Rhyhan 2018 年 9 月 21 日
Thanks

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

その他の回答 (1 件)

製品

Community Treasure Hunt

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

Start Hunting!

Translated by