User`s guide
Logging Image Data to Disk
6-49
ans =
40
Note Because it takes longer to write frames to a disk file than to memory, the
value of the DiskLoggerFrameCount property can lag behind the value of the
FramesAvailable property, which specifies the number of frames logged to
memory.
To verify that a disk file was created, go to the directory in which the log file resides
and make sure it exists. The exist function returns 2 if the file exists.
if(exist(my_log)==2)
disp('AVI file created.')
end
6
Close the AVI file object — Close the AVI file to make it available outside
the MATLAB environment. Closing the AVI file object ensures that the logged
data is written to the disk file. Be sure to use the value of the video input object
DiskLogger property, vid.DiskLogger, to reference the AVI file object, not the
original variable, aviobj, returned by the avifile function.
aviobj = close(vid.DiskLogger);
Use the original variable, aviobj, as the return value when closing an AVI file
object.
7
Clean up — Always remove image acquisition objects from memory, and the
variables that reference them, when you no longer need them.
delete(vid)
clear vid