can image tiff convert to grayscale
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
bozheng
el 20 de Abr. de 2024
Editada: Walter Roberson
el 20 de Abr. de 2024
as title
i have pictue which file is tiff but it is flase coding about convert (Image file cannot be uploaded)
i read the image and "gray_image = rgb2gray(image)"
but it is error what i should do
thanks Ur reading and answering
0 comentarios
Respuesta aceptada
Walter Roberson
el 20 de Abr. de 2024
Editada: Walter Roberson
el 20 de Abr. de 2024
zipname = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1674421/sample.zip';
tfile = fullfile(tempdir(), 'sample.zip');
filestr = urlwrite(zipname, tfile);
filenames = unzip(filestr);
imgname = filenames{1};
info = imfinfo(imgname)
%ExtraSamples of 2 indicates Unassociated Alpha Values
img = imread(imgname);
rgb = img(:,:,1:3) .* img(:,:,4); %take into account the alpha
gray_image = rgb2gray(rgb);
imshow(rgb); title('rgb')
imshow(gray_image); title('gray')
0 comentarios
Más respuestas (1)
Image Analyst
el 20 de Abr. de 2024
image is a built-in function. Do not use it as the name of your variable. Zip up your image and attach the zip file with the paperclip icon.
Ver también
Categorías
Más información sobre Convert Image Type en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!