Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How to extract a single frame from video file at given light conditions?

1 visualización (últimos 30 días)
Markus Danielsson
Markus Danielsson el 27 de Ag. de 2016
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I need to write some code that automatically runs a video file and extracts one(!) frame from that file at a given moment (specific light conditions). When the frame is extracted I want the next clip to automatically start and repeat the process. Anyone knows of such a code?
Thanks.

Respuestas (1)

Natch Ruengsakulrach
Natch Ruengsakulrach el 31 de Ag. de 2016
You may find the following pseudocode useful.
videoCell = {'a.mp4','b.mp4','c.mp4'};
for i = 1:numel(videoCell) % go through each video
v = VideoReader(videoCell{i});
while hasFrame(v) % read each frame
frame = readFrame(v);
if frameLightConditionMet(frame)
% Proceed to the next video once obtain a frame that meets
% specific light condition;
% Store that frame
break;
end
end
end

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by