This example shows how to capture and view video images from a Camera Link camera attached to the Bitflow™ Neon-CLB frame grabber board. Images are acquired with the model dxpcImMultiTarget running on the target computer and viewed with the model dxpcImMultiHost running on the host computer. dxpcImMultiTarget is a multirate multitasking model. Images are captured at 30Hz and then compressed and transmitted to the host computer at 10 Hz.
Computer Vision System Toolbox™
Bitflow Neon-CLB frame grabber installed in the target computer
Bitflow SDK installed on the host computer
Camera Link camera supported by the Bitflow Neon-CLB frame grabber
|On this page…|
% Open the model. mdlOpen = 0; systems = find_system('type', 'block_diagram'); if ~any(strcmp(systems,'dxpcImMultiTarget')) mdlOpen = 1; open_system('dxpcImMultiTarget'); end
% Build the model and download to the target computer, TargetPC1. set_param('dxpcImMultiTarget','RTWVerbose','off'); % Configure for a non-Verbose build. rtwbuild('dxpcImMultiTarget'); % Build and download application.
### Starting Simulink Real-Time build procedure for model: dxpcImMultiTarget ### Generated code for 'dxpcImMultiTarget' is up to date because no structural, parameter or code replacement library changes were found. ### Successful completion of build procedure for model: dxpcImMultiTarget ### Looking for target: TargetPC1 ### Download model onto target: TargetPC1
% Close the target model if we opened it. if (mdlOpen) bdclose('dxpcImMultiTarget'); end
This model receives compressed images sent by dxpcImMultiTarget, decompresses the images, and renders them to a video display.
% Open the model. mdlOpen = 0; systems = find_system('type', 'block_diagram'); if ~any(strcmp(systems,'dxpcImMultiHost')) mdlOpen = 1; open_system('dxpcImMultiHost'); end
% Using the Simulink Real-Time(TM) object variables |tg|, start the target model. start(tg); % Start the target model. pause(1); % Wait for 1 sec. % Start the host model. set_param(bdroot,'SimulationCommand','start'); % Start the host model. pause(10); % Wait for 10 sec.
% Render the video display. open_system([bdroot,'/To Video Display']);
% Plot the image size. open_system([bdroot,'/Scope']);
stop(tg); % Stop the target model. set_param(bdroot,'SimulationCommand','stop'); % Stop the host model. % Close the host model if we opened it. if (mdlOpen) bdclose('dxpcImMultiHost'); end % EOF dxpcImMultiDemo.m