v = videoinput('gige', 1, 'Mono8'); s = v.Source; % Determine optimum streaming parameters as described in the % "GigE Vision Quick Start Configuration Guide" % s.PacketSize = % s.PacketDelay =
Immediate acquisition By default, an immediate acquisition takes place when videoinput start function is executed, if a hardware triggering configuration is not explicitly specified.
For simplicity, this example performs an acquisition of a finite number of frames, and stores them in MATLAB base workspace.
% Set exposure time and mode s.ExposureMode = 'Timed'; s.ExposureTimeAbs = 4000; % The default videoinput trigger type is 'immediate', which is explicitly % configured here for clarity. triggerconfig(v, 'immediate'); % Specify number of frames to acquire v.FramesPerTrigger = 30; v.TriggerRepeat = 0; % Start continuous buffered acquisition and wait for acquisition to complete start(v); wait(v, 10); % Transfer acquired frames and timestamps from acquisition input buffer % into workspace [data, ts] = getdata(v, v.FramesAvailable);
Display acquired frames and plot acquisition timestamps.
figure; imaqmontage(data) figure; plot(ts, '.') xlabel('Frame index'); ylabel('Timestamp (s)');
% Specify total number of frames to be acquired % One frame is acquired for each external signal pulse. numFrames = 30; v.FramesPerTrigger = 1; v.TriggerRepeat = numFrames - 1; % Specify 'hardware' videoinput trigger type triggerconfig(v, 'hardware', 'DeviceSpecific', 'DeviceSpecific');
Configure camera for FrameStart trigger mode and specify external triggering signal input line and desired trigger condition.
% This requires setting the TriggerSelector first; once a TriggerSelector % value is selected, setting a trigger property (for example, % TriggerMode to 'on') applies only to the specified trigger mode (FrameStart). s.TriggerSelector = 'FrameStart'; s.TriggerSource = 'Line1'; s.TriggerActivation = 'RisingEdge'; s.TriggerMode = 'on'; % Specify a constant exposure time for each frame s.ExposureMode = 'Timed'; s.ExposureTimeAbs = 4000; % Start hardware-triggered buffered continuous acquisition, and wait for % acquisition to complete start(v) wait(v, 10) % Transfer acquired frames and timestamps from acquisition input buffer % into workspace [data2, ts2] = getdata(v, v.FramesAvailable);
Display acquired frames and timestamps
figure; imaqmontage(data2) figure; plot(ts2, '.') xlabel('Frame index'); ylabel('Timestamp (s)');
% Specify total number of frames to be acquired % One frame is acquired for each external signal pulse. numFrames = 30; v.FramesPerTrigger = 1; v.TriggerRepeat = numFrames - 1; % Specify 'hardware' videoinput trigger type triggerconfig(v, 'hardware', 'DeviceSpecific', 'DeviceSpecific');
Configure camera for FrameStart trigger mode and specify external triggering signal input line and desired trigger condition.
% This requires setting the TriggerSelector first; once a TriggerSelector % value is selected, setting a trigger property (for example, % TriggerMode to 'on') applies only to the specified trigger mode (FrameStart). s.TriggerSelector = 'FrameStart'; s.TriggerSource = 'Line1'; s.TriggerActivation = 'RisingEdge'; s.TriggerMode = 'on'; % For exposure time control configure a TriggerWidth exposure mode s.ExposureMode = 'TriggerWidth'; % Specify camera ExposureOverlapTimeMaxAbs in microseconds s.ExposureOverlapTimeMaxAbs = 5000; % Start hardware-triggered buffered continuous acquisition, and wait for % acquisition to complete start(v) wait(v, 10) % Transfer acquired frames and timestamps from acquisition input buffer % into workspace [data3, ts3] = getdata(v, v.FramesAvailable);
Display acquired frames and timestamps
figure; imaqmontage(data3) figure; plot(ts3, '.') xlabel('Frame index'); ylabel('Timestamp (s)'); figure; plot(diff(ts3), '-x'); xlabel('Frame index'); ylabel('diff(Timestamp) (s)');
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.