Sequence Images on Matlab

2 ビュー (過去 30 日間)
Richie Chang
Richie Chang 2020 年 3 月 12 日
回答済み: Vidip 2024 年 4 月 8 日
clc; clear; close all;
%%Test
vid=VideoReader('MVI_1444.MOV');
numFrames = vid.NumberOfFrames;
for i = 1:25:numFrames
frames = read(vid,i);
imwrite(frames,['Image' int2str(i), '.jpg']);
im(i)=image(frames);
endclc; clear; close all;
%%Test
vid=VideoReader('MVI_1444.MOV');
numFrames = vid.NumberOfFrames;
for i = 1:25:numFrames
frames = read(vid,i);
imwrite(frames,['Image' int2str(i), '.jpg']);
im(i)=image(frames);
end
%%To Extract Frame
vid=VideoReader('MVI_1444.MOV');
numFrames = vid.NumberOfFrames;
for i = 1:25:numFrames
frames = read(vid,i);
imwrite(frames,['Image' int2str(i), '.jpg']);
im(i)=image(frames);
end
How can i play the image sequences like a video ?
How can i overwrite the file into Image1.jpg, Image2.jpg, ..... ImageN.jpg ?

回答 (1 件)

Vidip
Vidip 2024 年 4 月 8 日
To play back the image sequences like a video and overwrite the files into a consistent naming format (Image1.jpg, Image2.jpg, ..., ImageN.jpg), you can make some adjustments to your MATLAB code.
To play the image sequences like a video, you can use a loop along with the ‘imshow’ function and a short pause to simulate the video playback and to save the images with a consistent naming format (Image1.jpg, Image2.jpg, ..., ImageN.jpg), you can modify the loop where you save the frames. When constructing the filename, ensure that the frame index (i) starts from 1 and increments in the way you desire.
For more information, you can refer to the documentation link below:

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by