Contents

Step 1: Access and Configure a Device.

Create a video input object and access its video source object to configure the desired acquisition rate. The acquisition
rate is determined by the value of the device specific FrameRate property of the video source object.

Note, since FrameRate is a device specific property, not all devices may support it.

Step 2: Log and Retrieve Data.

Initiate the acquisition and retrieve the logged frames and timestamps.

% Start the acquisition.
start(vidobj)
% Wait for data logging to end before retrieving data. Set the wait time% to be equal to the expected time to acquire the number of frames% specified plus a little buffer time to accommodate overhead.
waittime = actualRate * (vidobj.FramesPerTrigger + vidobj.TriggerFrameDelay) + 5;
wait(vidobj, waittime);
% Retrieve the data and timestamps.
[frames, timeStamp] = getdata(vidobj);

Step 3: Calculate the Acquisition Rate.

By plotting each frame's timestamp, one can verify that the rate of acquisition is constant.

% Find the average time difference between frames.
avgTime = mean(diffFrameTime)

avgTime =
0.0333

% Determine the experimental frame rate.
expRate = 1/avgTime

expRate =
30.0245

Comparing the time difference between the experimental and the known frame rate, the percent error can be calculated. Since
a generic USB web camera is being used as the acquisition device, it is to be expected that the actual device frame rate will
fluctuate.