Effacer les filtres
Effacer les filtres

using other image following error is coming.lena.jpg is not giving any error

3 vues (au cours des 30 derniers jours)
Komal Gaikwad
Komal Gaikwad le 1 Avr 2018
Error using medfilt2 Expected input number 1, A, to be two-dimensional.
Error in medfilt2>parse_inputs (line 107) validateattributes(a, ...
Error in medfilt2 (line 48) [a, mn, padopt] = parse_inputs(varargin{:});
Error in maingui1>noisyimg_Callback (line 124) median_image=medfilt2(im_n)
Error in gui_mainfcn (line 95) feval(varargin{:});
  3 commentaires
Komal Gaikwad
Komal Gaikwad le 7 Mai 2018
OK thnx,but i need black and white image coz making changes in code will lead to problem.
Walter Roberson
Walter Roberson le 7 Mai 2018
You should be editing your code to have the above lines, and then either
if ndims(im) > 2; im = rgb2gray(im); end
or else
im = im2bw(im, graythresh(im));

Connectez-vous pour commenter.

Réponses (1)

Image Analyst
Image Analyst le 1 Avr 2018
You probably had your image as a color image. You need to call medfilt2 on each color channel one at a time, or else convert your image to grayscale with rgb2gray().
  7 commentaires
Komal Gaikwad
Komal Gaikwad le 7 Mai 2018
Sir i tried using this command ,but in my code it is giving error for different function.
Walter Roberson
Walter Roberson le 7 Mai 2018
Once you use rgb2gray() then what is the new error that shows up?

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by