Fixed number of frames video buffer
Mostrar comentarios más antiguos
Hi,
I get a new picture from my camera every 100ms. I want to store some frames to understand what happens before and after an event.
How can I implement a buffer that continuously saves the last 30 pictures?
The last lines of code shows what I want to do.
Any help with the saving of frames after the trigger event is also appreciated, but I think I can do it.
while true
%get video
I = videoinput('winvideo', 2, 'YUY2_1280x720');
I.ReturnedColorspace = 'rgb';
I = getsnapshot(I);
vid.ROIPosition = [585 400 648 313]; % crop the image to smaller ROI
% preprosess the image
I = imresize(I,frameSize);
I= imsubtract(I,background);
I = imadjust(I,[low high]);
%----------------------------------- save last 30 frames of I
% if something happens
% save 30 more more frames
% merge the two videos
end
2 comentarios
Walter Roberson
el 21 de Abr. de 2021
Built in logging to disk mode.
Eirik Furuholt
el 21 de Abr. de 2021
Respuestas (1)
Shiva Kalyan Diwakaruni
el 5 de Mayo de 2021
0 votos
Hi,
You can try Creating a video reader object and read one or more video frames using the frame indices.
below is the link to documentation
Hope it helps.
Categorías
Más información sobre Video Formats and Interfaces en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!