Force a Specific Camera Aquisition Framerate in a realtime Matlab Loop -


i have function running in real time controlling hardware timing, etc. want able record video well, i've created global video object in matlab, , set triggering manual. right now, have each iteration of realtime loop record frame , write disk. i'm changing ill record memory till hit limit, , writing disk. however, i'd guarantee no matter how fast real time loop running, capture 15 frames per second.

thinking though, how can make capture 15 frames not dramatically close each other? if real time loop running lightning fast, 15 frames gathered @ "beginning" , capture no change has occurred during second. in other words, faster real time loop is, more sampling act 1 frame per second (which has 14 other copies made).

for example,

% main file function start()  global vid; global mylogger; vid = videoinput('winvideo', 1, 'mjpg_160x120'); src = getselectedsource(vid); triggerconfig(vid, 'manual'); vid.framespertrigger = 1; vid.loggingmode = 'disk&memory'; imaqmem(512000000); % 512 mb mylogger = videowriter('c:\users\myname\desktop\output.avi', 'motion jpeg avi'); mylogger.quality = 50; mylogger.framerate = 15; vid.disklogger = mylogger; src.framerate = '15.0000'; vid.returnedcolorspace = 'grayscale';  start(vid); open(mylogger);  initiatefastloop();  close(mylogger);  stop(vid);   end 

the real time piece:

function initiatefastloop   global vid; global mylogger;  while(flag)     % perform lightning fast stuff     frame = getsnapshot(vid);     writevideo(mylogger, frame); end  end 

the video generated higher framerate, , don't want capture frame every single time realtime loop runs, , don't want set simple upper limit because of problem described above. great!


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -