動画の平均輝度の時間プロット
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Noritaka Kishi
el 21 de Mzo. de 2019
Respondida: Kenta
el 23 de Mzo. de 2019
aviなどの形式の動画について、全画面又はエリアを指定した上で、横軸が時間(又はフレーム)、縦軸が平均輝度のグラフを描画するにはどうすればよいでしょうか?
0 comentarios
Respuesta aceptada
Kenta
el 23 de Mzo. de 2019
%% 第一フレームの読み取り
close all;clear;clc
Video = VideoReader('shuttle.avi');
img = readFrame(Video);
figure;imshow(img)
%% 関心領域を指定(左クリックで対象の多角形を作成=>右クリック=>マスクの作成)
ROI = roipoly;
index=find(ROI==1);
close all
%% 各フレームを読み取り=>そのフレームの輝度を計算
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_in_ROI=int(index);
int_list(i)=mean(int_in_ROI);
i=i+1;
end
%% グラフの表示
figure;
plot(1:i-1,int_list')
xlim([1 i-1])
xlabel('フレーム数')
ylabel('平均輝度')
title('各フレームにおけるROIの平均輝度')
roipolyでクリックしながら、対象領域を指定すれば、その領域のフレームごとの輝度が求まると思います。
各時間ごとがよければ、横軸の値にフレームレートの逆数をかけてください。
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre オーディオとビデオ en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!