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: write images to different folders
Replies: 2   Last Post: Dec 11, 2012 12:42 PM

Advanced Search

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

Posts: 3
Registered: 12/7/12
write images to different folders
Posted: Dec 7, 2012 4:56 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

i'm doing a work in frame extraction from video. i want to save the extracted frames to many subfolders that exists in a particular location(not current directory). I want to save the first 75 extracted frames in subfolder1, the next 75 frames in subfolder2, and so on...
this is the code i have written..

xyloObj = mmreader('F:short\mov1.mpg');

nFrames = xyloObj.NumberOfFrames;
disp(nFrames);
n=1;
% Read one frame at a time.

for j = 1 : (nFrames/75)
foldername=strcat('mov1seg',int2str(j));
f1=fullfile('F:xylo\mov1\',foldername);
mkdir(f1);
for k=n: n+74
mov(k).cdata = read(xyloObj, k);
mov(k).colormap = [];
%imshow(mov(k).cdata);
imagename=strcat(int2str(k), '.jpeg');
imwrite(mov(k).cdata, strcat('F:xylo\mov1\mov1seg',int2str(j),imagename));

end
n=n+75;

end

i'm creating subfolders automatically in this code. my frames are getting saved to a single folder.
can someone help me to write the frames to the subfolders i created in this code one after another..



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.