Prev: real-time object tracking using optical flow / XY coordinates needed
Next: Help with the question
From: queen f on 1 May 2010 09:50 Hi , I am doing a matlab project which i need to read a video and then split it into frames, then blur some parts of it and again convert it back to the video, i used the following code, but it gives me error, any help?? Obj=mmreader('movie12.00.avi'); get (Obj) vidFrames=read(Obj, 200); numFrames=get(Obj,'numberOfFrames'); for k=1:numFrames-1 mov(k).cdata=vidFrames(:,:,:,k); mov(k).colormap=[]; end fig1=figure; set(fig1,'position', [450 450 580 600]) montuge(vidFrames); fig2=figure; set(fig2,'position', [40 350 Obj.width Obj.height]) movie(fig2,mov, 1,Obj.FrameRate); numberofFramesWritten=0; CurrentFolder=('Z:\\cert\09_10\') for frame=1:numFrames-1 CurrentFrame=mov(frame).cdata; CurrentFileName=sprintf('Frame %4.4d.png', frame); CurrentFullFileName=fullfile(CurrentFolder, CurrentFileName); imwrite(CurrentFrame,CurrentFullFileName,'png'); prog=sprintf('wrote frame %4d of %d.',frame,numFrame); disp(prog); numberofFramesWritten=numberofFramesWritten + 1; end
|
Pages: 1 Prev: real-time object tracking using optical flow / XY coordinates needed Next: Help with the question |