Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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

조회 수: 1 (최근 30일)
Markus Danielsson
Markus Danielsson 2016년 8월 27일
마감: MATLAB Answer Bot 2021년 8월 20일
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.

답변 (1개)

Natch Ruengsakulrach
Natch Ruengsakulrach 2016년 8월 31일
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

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by