viewing events -凯发k8网页登录
events occur during an acquisition at a particular time when a condition is met. these events include:
error
framesacquired
start
stop
timer
trigger
all acquisitions consist of at least 3 events:
starting the device
triggering the device
stopping the device.
executing an acquisition
initiate a basic acquisition using a video input object.
% access an image acquisition device. vidobj = videoinput('winvideo', 1); % use a manual trigger to initiate data logging. triggerconfig(vidobj, 'manual'); % start the acquisition. start(vidobj) % trigger the object to start logging and allow the acquisition to run for % couple of seconds. trigger(vidobj) pause(2); % stop the acquisition stop(vidobj)
viewing event information
to view event information for the acquisition, access the eventlog
property of the video input object. events are recorded in chronological order.
% view the event log.
events = vidobj.eventlog
events = 1x3 struct array with fields: type data
each event provides information on the state of the object at the time the event occurred.
% display first event.
event1 = events(1)
event1 = type: 'start' data: [1x1 struct]
data1 = events(1).data
data1 = abstime: [2005 6 5 23 53 14.1680] framememorylimit: 341692416 framememoryused: 0 framenumber: 0 relativeframe: 0 triggerindex: 0
% display second event.
event2 = events(2)
event2 = type: 'trigger' data: [1x1 struct]
data2 = events(2).data
data2 = abstime: [2005 6 5 23 53 14.7630] framememorylimit: 341692416 framememoryused: 0 framenumber: 0 relativeframe: 0 triggerindex: 1
% display third event.
event3 = events(3)
event3 = type: 'stop' data: [1x1 struct]
data3 = events(3).data
data3 = abstime: [2005 6 5 23 53 16.9970] framememorylimit: 341692416 framememoryused: 768000 framenumber: 5 relativeframe: 5 triggerindex: 1
% once the video input object is no longer needed, delete % it and clear it from the workspace. delete(vidobj) clear vidobj