Error using imfinfo()
17 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Walter Roberson
am 22 Apr. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Numeric Types finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!