필터 지우기
필터 지우기

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

조회 수: 2 (최근 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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by