動画からフレーム抽出の後、輝度を求める
Afficher commentaires plus anciens
動画ファイル(全1054フレーム)からフレームを抽出し、各フレーム毎のピクセルに対する輝度を求めたいと考えております。
各フレーム抽出の後、輝度算出の方法をご教示願います。よろしくお願いいたします。
1 commentaire
Shunichi Kusano
le 17 Juin 2020
このページの右側に出ている「動画の平均輝度の時間プロット」という参考のAnswerが参考になりそうですが、いかがでしょうか。
Réponses (1)
Kenta
le 18 Juil 2020
こんにちは、上のURLが使えると思います。上ではROIを切り出していますが、切り出さない場合は以下のようにすればよいとおもいます。
こちらでいかがでしょうか?
%% 第一フレームの読み取り
close all;clear;clc
Video = VideoReader('shuttle.avi');
%% 各フレームを読み取り=>そのフレームの輝度を計算
i=1;
Video.CurrentTime=0; %1フレーム目から読み取り
int_list=zeros(1,round(Video.Duration*Video.FrameRate));
while hasFrame(Video)
img = readFrame(Video);
int=mean(img,3);
int_list(i)=int;
i=i+1;
end
%% グラフの表示
figure;
plot(1:i-1,int_list')
xlim([1 i-1])
xlabel('フレーム数')
ylabel('平均輝度')
title('各フレームにおけるROIの平均輝度')
Catégories
En savoir plus sur Video Formats and Interfaces dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!