Error using imfinfo()
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Every time I run this code it says that for some reason there is an error in line 142 of the function imfinfo:
filename=uigetfile('*.tif');
[r c]=size(imfinfo(filename));
for i = 1:r
rgb = imread(filename, i);
set(handles.textSlidenumber, 'String', i);
status = get(radiobuttonRBG, 'Value');
if status
imshow(rgb);
else
gray = rgb2gray(rgb);
imshow(gray);
end
line 142 in imfinfo is:
error(message('MATLAB:imagesci:imfinfo:fileOpen', filename));
0 comentarios
Respuestas (1)
Walter Roberson
el 22 de Abr. de 2020
filename=uigetfile('*.tif');
The output you get from that call will not include any directory information. If the user chooses something that is not in the current directory, you will have difficulty.
[filename, pathname] = uigetfile('*.tif');
if ~ischar(filename)
%user canceled
return
end
filename = fullfile(pathname, filename);
0 comentarios
Ver también
Categorías
Más información sobre Numeric Types 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!