make video to combine two png series from different file folder

조회 수: 1 (최근 30일)
yijun guo
yijun guo 2020년 4월 21일
댓글: yijun guo 2020년 4월 26일
Hello,
i would like to combine two png series from different file folder and make video
for example: below I attached screenshot of the png folders of pressure and velocity. I would like to make a video to combine pressure and velocity.
thank you in advance
Yijun

채택된 답변

Akira Agata
Akira Agata 2020년 4월 22일
How about the following solution?
s = dir('*.png');
v = VideoWriter('output.avi');
open(v);
for kk = 1:numel(s)
filePath = fullfile(s(kk).folder,s(kk).name);
I = imread(filePath);
writeVideo(v,I);
end
close(v);
  댓글 수: 6
Akira Agata
Akira Agata 2020년 4월 25일
You can simply adjust the image size just before combining them, like:
...
F_IR = imread(filePath_IR);
F_OR = imread(filePath_OR);
F_OR = imresize(F_OR,size(F_IR,[1,2])); % <- Added this line
bothImages = [F_IR, F_OR];
...
yijun guo
yijun guo 2020년 4월 26일
thank you for you help. It works
best regards
Yijun

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by