Effacer les filtres
Effacer les filtres

How can I change this line?

2 vues (au cours des 30 derniers jours)
GeonWoo Jeon
GeonWoo Jeon le 4 Sep 2017
Commenté : GeonWoo Jeon le 4 Sep 2017
%%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');
  1 commentaire
KSSV
KSSV le 4 Sep 2017
Change to what?

Connectez-vous pour commenter.

Réponse acceptée

Guillaume
Guillaume le 4 Sep 2017
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;
  1 commentaire
GeonWoo Jeon
GeonWoo Jeon le 4 Sep 2017
Thanks for your help!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Purple dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!