How can I change this line?

2 次查看(过去 30 天)
%%displaying
load(['result\' dataName '_DECOLOR.mat'],'dataName','Mask','LowRank','tau');
moviename = ['result\' dataName,'_DECOLOR.avi']; fps = 12;
mov = avifile(moviename,'fps',fps,'compression','none');
for i = 1:size(ImData,3)
figure(1); clf;
subplot(2,2,1);
imshow(ImData(:,:,i)), axis off, colormap gray; axis off;
title('Original image','fontsize',12);
subplot(2,2,2);
imshow(LowRank(:,:,i)), axis off,colormap gray; axis off;
title('Low Rank','fontsize',12);
subplot(2,2,3);
imshow(ImData(:,:,i)), axis off,colormap gray; axis off;
hold on; contour(Mask(:,:,i),[0 0],'y','linewidth',5);
title('Segmentation','fontsize',12);
subplot(2,2,4);
imshow(ImData(:,:,i).*uint8(Mask(:,:,i))), axis off, colormap gray; axis off;
title('Foreground','fontsize',12);
mov = addframe(mov,getframe(1));
end
How can I change the line ??
mov = avifile(moviename,'fps',fps,'compression','none');

采纳的回答

Guillaume
Guillaume 2017-9-4
avifile was deprecated in R2012a and removed in R2014b. Use VideoWriter instead. That line can probably be replaced by:
writer = VideoWriter(moviename, 'Uncompressed AVI');
writer.FrameRate = fps;
writer.open;
and the addframe line by:
writer.writeVideo(getframe(1));
once all frames are written don't forget to close the file with:
writer.close;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Purple 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!