フィルターのクリア

Video from 3D matrix

3 ビュー (過去 30 日間)
Alexandr Lozak
Alexandr Lozak 2019 年 2 月 26 日
コメント済み: Alexandr Lozak 2019 年 3 月 5 日
Hi all, i have problem with making video from 3D matrix. I read other people examples and i tried to repeat them.
but Matlab gives me error:
v = VideoWriter('TeAc.avi');
open(v);
%% initial frame
Z = Di3(:,:,1);
Z=surf(Z);
Z.LineStyle='none';
axis tight manual
colormap jet
set(gca,'nextplot','replacechildren');
%% Loop of images
for k = 1:2550
Z=surf(Di3(:,:,k));
Z.LineStyle='none';
axis tight manual
colormap jet
set(gca,'nextplot','replacechildren');
frame = getframe;
writeVideo(v,frame);
end
close(v);
Error using VideoWriter/writeVideo (line 356)
Frame must be 435 by 343
frame.cdata is 344*435*uint8
  1 件のコメント
Alexandr Lozak
Alexandr Lozak 2019 年 2 月 26 日
編集済み: Alexandr Lozak 2019 年 3 月 5 日
I found part of code that helped me
%% Loop of images
for k = 1:2550
Z=surf(Di3(:,:,k));
Z.LineStyle='none';
axis tight manual
colormap jet
set(gca,'nextplot','replacechildren');
set(gcf,'Renderer','zbuffer'); % addition of this line helped me
frame = getframe(gcf); % and change in getframe
writeVideo(v,frame);
end
close(v);

サインインしてコメントする。

採用された回答

Pinkesh Narsinghani
Pinkesh Narsinghani 2019 年 3 月 5 日
From the above information , It seems like you are facing this error because frame size is changing on an iteration of your for loop .I would suggest you to refer the following MATLAB Answer and make changes in your code accordingly :
  1 件のコメント
Alexandr Lozak
Alexandr Lozak 2019 年 3 月 5 日
Yes.You are right.
Thank you for answer

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by