Is VideoInput disklogger NumFrames correct?
Mostra commenti meno recenti
Hi,
First of all - this is the 6th time I am trying to write this post - beyond a certain number of lines, the editor becomes unresponsive in my browser (Microsoft Edge) - can't seem to post any of my code due to this reason, so I'll just have to describe what I'm seeing:
I'm using the videoinput in disklogger mode to capture frames for a certain duration from my laptop webcam. I've set up the properties (which I can't share easily due to this editor): FramesPerTrigger=1, FramesAcquiredFcnCount=1, FrameGrabInterval=1, TriggerRepeat=inf, FramesAcquiredFcn=@cameraHandler, TimerPeriod=logDuration, Timeout=logDuration+10 (to avoid timeout error), TimerFcn=@stopLogger (which stops the logging).
Separately, I've defined the FramesAcquiredFcn to grab and store the epoch time from my laptop into a vector (this should happen for each frame given the settings above):
temp=posix(datetime('now','TimeZone','UTC')); frameTimeStamps(1,frameCount)=temp;frameCount=frameCount+1;
(Ofcourse, frameCount is defined to be 1 outside the callback function).
What I'm seeing is that the videoinput object reports FramesAcquired as 580, while I only collect 579 timestamps using the FramesAcquiredFcn. So, I'm wondering whether:
1) The videoinput object is reporting an incorrect framecount, or the FramesAcquiredFcn isn't being triggered for one frame?
2) There is any way to add the epoch timestamp natively into the logged file (i.e. through the VideoWriter), without having to do this in the FramesAcquiredFcn? For my purposes, it needs to be my laptop's epochtime, because I've synced other input sensors to use my laptop's time (they don't have their own RTC).
1 Commento
Imran Khan
il 14 Gen 2021
Modificato: Imran Khan
il 14 Gen 2021
Risposte (0)
Categorie
Scopri di più su Image Preview and Device Configuration in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!