動画ファイルから画像ファイルに変換する方法
24 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
動画ファイルを読み込み、一つ一つのフレームを画像データとしてjpgで保存したいのですが、やり方がわからないため、教えていただきたいです。
0 Commenti
Risposte (1)
Dyuman Joshi
il 12 Ott 2023
%% Create object to read video files
%Replace the file-name accordingly
v = VideoReader("filename.extension");
%% Read all the frames
allFrames = read(v);
%% Number of frames
num = size(allFrames, 4);
%% Write each frame as a jpg file
for k=1:num
name = sprintf('Frame_%d.jpg', k);
imwrite(allFrames(:,:,:,k), name)
end
The format of the images will be according to format of the video - Output argument from read()
For more information, refer to -
0 Commenti
Vedere anche
Categorie
Scopri di più su Motion Detection in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!