converting tiff file to grey scale using im2gray error at position 1
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I try to convert my tiff files to grey scale images. I read that I should use im2grey. But I get an error that there is an invaling argument at position 1 and that the value must be numeric. What does this mean?
0 commentaires
Réponses (1)
Walter Roberson
le 26 Avr 2021
You have to read the data in first; you cannot pass in a file name
img = imread('flamingos.jpg');
grimg = im2gray(img);
imshow(grimg)
3 commentaires
Walter Roberson
le 26 Avr 2021
Example:
for K = 1 : 5
filename = sprintf('img%05d.tiff', K);
outputs(:,:,K) = im2gray(imread(filename));
end
Voir également
Catégories
En savoir plus sur Convert Image Type dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!