Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Importing & Exporting
Replies: 1   Last Post: Nov 11, 2012 5:09 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Muhammad

Posts: 1
Registered: 11/11/12
Importing & Exporting
Posted: Nov 11, 2012 1:57 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


% I have to import images from 40 classes (directories) and each directory
% has 7 images which is i called as subjects. then i need to make a vector
% form of each image and then save it into linear array.
% note my pictures is in grayscale which i will need to be in a linear
% array.
% Below I have written the code but it is giving me following error
%??? Error using ==> imread at 374
%File "d:/ahsan/biometrics/imagedatabase/ATT/s1/1.PGM" does not exist.

%Error in ==> Pr4 at 15
%filename = imread(
%sprintf('d:/ahsan/biometrics/imagedatabase/ATT/s%d/%d.PGM',i,k));


%start program
clc
clear all ;

class = 40 ; % We have 40 folders in our main directory.
subjects = 7; % we have 7 images in our single directory.

for i = 1:class % this loop traverse all directories
for k = 1:subjects % this loop traverse images in single directory
filename = imread( sprintf('d:/ahsan/biometrics/imagedatabase/ATT/s%d/%d.PGM',i,k));
image = importdata (filename, '.PGM');
Y = ones(1,10); %Column array
Y1 = filename;
Y1= reshape(myfilename,1,[]);
Y=Y1;
end
end
%end program


Date Subject Author
11/11/12
Read Importing & Exporting
Muhammad
11/11/12
Read Re: Importing & Exporting
dpb

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.