Fetching images from other location
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I want to read in x number of images from a folder located in another folder using imread.
How do I do this?
I get error when I write;
base='/Users/..../folder/';
files = dir([base,'*.bmp']);
PictSize=size(imread([base,files(1).name],'bmp'));
My error message is:
??? Index exceeds matrix dimensions.
Error in ==> CalcLosses at 16
PictSize=size(imread([base,files(1).name],'bmp'));
댓글 수: 0
답변 (1개)
Walter Roberson
2012년 8월 8일
"files" probably came out empty.
Note: it would be better to use
files = dir( fullfile(base,'*.bmp') );
and then to check whether "files" came out empty.
댓글 수: 3
Image Analyst
2012년 9월 25일
You don't have any files in that location. It might be a relative path since you forgot the drive letter. Maybe try adding a drive letter to get a full directory path and see what happens.
참고 항목
카테고리
Help Center 및 File Exchange에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!