hi guys how should i fix i=this code error its supposed to be changing an image to gray scale mind u this is in app designer

1 view (last 30 days)

Accepted Answer

Kevin Holly
Kevin Holly on 2 Dec 2022
Have you tried using im2gray instead of rgb2gray?
  5 Comments
jana
jana on 2 Dec 2022
so i did as you said and it worked thank u very much but the last thing is the gaussian and periodic noise this is my code for them and they didnt work how can i fix them plz?
this is the gaussina noise code
a=(app.Image);
noise=imnoise(a,'gaussian');
I=imshow(noise,'parent',app.UIAxes2,...
'XData',[1 app.UIAxes2.Position(3)],...
'YData',[1 app.UIAxes2.Position(4)]);
app.UIAxes2.XLim=[0 I.XData(2)];
app.UIAxes2.YLim=[0 I.YData(2)];
and this the periodic noise code
a=(app.Image);
s=size(a);
[x,y]=meshgrid(1:s(1),1:s(2));
p=sin(x/3+y/5)+1;
noise=(im2double(a)+p/2)/2;
I=imshow(noise,'parent',app.UIAxes2,...
'XData',[1 app.UIAxes2.Position(3)],...
'YData',[1 app.UIAxes2.Position(4)]);
app.UIAxes2.XLim=[0 I.XData(2)];
app.UIAxes2.YLim=[0 I.YData(2)];
jana
jana on 2 Dec 2022
sorry i also have this low pass filter also doesnt work how can i fix it
a=(app.Image);
f1=fspecial('average',[5,5]);
I=imshow(f1,'parent',app.UIAxes2,...
'XData',[1 app.UIAxes2.Position(3)],...
'YData',[1 app.UIAxes2.Position(4)]);
app.UIAxes2.XLim=[0 I.XData(2)];
app.UIAxes2.YLim=[0 I.YData(2)];

Sign in to comment.

More Answers (0)

Categories

Find more on File Operations in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!