필터 지우기
필터 지우기

a numeric array containing all images' numbers

조회 수: 2 (최근 30일)
Jessica
Jessica 2012년 3월 15일
Hi sir,
Please i want to make an array that contains the images' numbers in the database ( an numeric array.
Here is my code:
file = dir(fullfile('C\image.orig','*.jpg'));
file = file(~[file.isdir]);
for k=1:1000
image2= imread(fullfile('C:\image.orig',(file(k).name)));
n=file(k).name;
disp(fullfile('C:\image.orig',(file(k).name)));
end
Thank you in advance
  댓글 수: 2
Geoff
Geoff 2012년 3월 15일
When you say the images' numbers, do you mean the image data? ie, all the pixel values?
Image Analyst
Image Analyst 2012년 3월 16일
And what is "the database (an numeric array"? Was that something in your code? If so, which numeric array was it? Did I miss it? Or is it simply a folder full of image files??? I suggest you read this: http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2012년 3월 15일
imagenumbers = str2double(regexp({file.name}, '^\d+', 'match'));

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by