User`s guide
Logging Image Data to Disk
6-43
This example uses a GigE Vision device in a grayscale format (Mono10).
1
Create a video input object that accesses a GigE Vision image acquisition device and
uses grayscale format at 10 bits per pixel.
vidobj = videoinput('gige', 1, 'Mono10');
2
You can log acquired data to memory, to disk, or both. By default, data is logged
to memory. To change the logging mode to disk, configure the video input object's
LoggingMode property.
vidobj.LoggingMode = 'disk'
3
Create a VideoWriter object with the profile set to Motion JPEG 2000.
logfile = VideoWriter('logfile.mj2, 'Motion JPEG 2000')
4
Configure the video input object to use the VideoWriter object.
vidobj.DiskLogger = logfile;
5
Now that the video input object is configured for logging data to a Motion JPEG 2000
file, initiate the acquisition.
start(vidobj)
6
Wait for the acquisition to finish.
wait(vidobj, 5)
7
When logging large amounts of data to disk, disk writing occasionally lags behind
the acquisition. To determine whether all frames are written to disk, you can
optionally use the DiskLoggerFrameCount property.
while (vidobj.FramesAcquired ~= vidobj.DiskLoggerFrameCount)
pause(.1)
end
8
You can verify that the FramesAcquired and DiskLoggerFrameCount properties
have identical values by using these commands and comparing the output.
vidobj.FramesAcquired
vidobj.DiskLoggerFrameCount
9
When the video input object is no longer needed, delete it and clear it from the
workspace.
delete(vidobj)
clear vidobj