フィルターのクリア

converting tiff file to grey scale using im2gray error at position 1

5 ビュー (過去 30 日間)
Lotte van Dijk
Lotte van Dijk 2021 年 4 月 26 日
コメント済み: Lotte van Dijk 2021 年 4 月 26 日
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?

回答 (1 件)

Walter Roberson
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
Walter Roberson 2021 年 4 月 26 日
Example:
for K = 1 : 5
filename = sprintf('img%05d.tiff', K);
outputs(:,:,K) = im2gray(imread(filename));
end
Lotte van Dijk
Lotte van Dijk 2021 年 4 月 26 日
That worked thank you!

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

カテゴリ

Help Center および File ExchangeImport, Export, and Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by