I want to read every second frame from video

5 ビュー (過去 30 日間)
Eliska Paulikova
Eliska Paulikova 2022 年 10 月 22 日
編集済み: Image Analyst 2022 年 10 月 22 日
Hello, I have video which has 15 GB, so it takes to long to read it, I also need to add the segmentation to frames. So I decided to apply it only for every second or third frame. How I can do it?
Thank you for your answer.

採用された回答

Image Analyst
Image Analyst 2022 年 10 月 22 日
編集済み: Image Analyst 2022 年 10 月 22 日
Yes, in the read() function just pass in the frame number you want to read.
numberOfFrames = videoReaderObject.NumFrames;
framesToRead = 1: 2 : numberOfFrames;
for k = 1 : length(framesToRead)
% Extract the frame from the movie structure.
thisFrame = read(videoReaderObject, framesToRead(k));
end
See attached demos.
  1 件のコメント
Eliska Paulikova
Eliska Paulikova 2022 年 10 月 22 日
Thank you so much

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by