Set path or Add path in MATLAB
조회 수: 44 (최근 30일)
이전 댓글 표시
I'm facing problem with managing directory in MATLAB. I'm working on CBIR, in this project I'm using uigetfile to get image files, these images must be stored in a folder from where i retrieve images and also must add this folder to directory/path, If that folder is not added to path and if i run program i get an error stating 'image.ext' does not exist'.
suppose if user want to search for similar images for his/her own query image and if he/she is not familiar with MATLAB they simply input query image from remote folder which was not added to folder. Then definitely he/she will get error.
Is there any way to get off from this?
댓글 수: 2
Walter Roberson
2020년 4월 26일
loadMNISTimages is not a MATLAB function.
One implementation of it is at https://github.com/davidstutz/matlab-mnist-two-layer-perceptron/blob/master/loadMNISTImages.m
답변 (2개)
Jan
2013년 6월 13일
편집: Jan
2013년 6월 13일
Do not add folders to the PATH only to read some data files. Using the full path is much safer and quicker:
cd('C:\YourDefault\ImagePath');
[FileName, PathName] = uigetfile(*.jpg', 'Select an image file:');
if ~ischar(FileName)
disp('User pressed Cancel');
return; % Or what ever is applicable
end
File = fullfile(PathName, FileName);
img = imread(File);
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!