converting tiff file to grey scale using im2gray error at position 1
6 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Walter Roberson
2021-4-26
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 个评论
Walter Roberson
2021-4-26
Example:
for K = 1 : 5
filename = sprintf('img%05d.tiff', K);
outputs(:,:,K) = im2gray(imread(filename));
end
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!