📄 test_library.m
字号:
%function test_library(arguments);
%Agilent ADCM-1670 camera module library test.
% TEST_LIBRARY(ARGUMENTS);
%
% Input Parameters:
% ================
%
% arguments ---------> Command line arguments (text):
% -d enable debug mode
%
% Output Parameters:
% =================
%
% NONE.
%
% See also N/A.
% Stephan Hengstler
% Stanford Wireless Sensor Networks Lab
% December 22, 2005
%
% Last modified: 02-03-2005
% cmAPITest: dos('cmAPITest COM1 sample_xx.jpg 1')
clear, clc
%********************* Agilent ADCM-1670 Camera Module Library Test ***********************
% parse input arguments
if (exist('arguments') == 1)
switch arguments(1:2)
case '-d'
debug = 1;
end
end
%--- Section: Global Variables ------------------------------------------------------------
global colorm; % color map
global handle; % device handle
global imager; % image array
global PORT; % communications port
%--- Section: System Parameters -----------------------------------------------------------
PORT = 'COM1';
%--- Section: Library Function Test -------------------------------------------------------
% open communications session
status = adcm1670_library('open');
% initialize camera module
status = adcm1670_library('init');
% initialize figure
figure(1), clf
release = version;
if (hex2dec(release(1)) > 5)
set(gcf,'currentcharacter',' ')
end
% initialize frame counter
frame = 1;
% repeat until break
while(1)
% capture current frame
status = adcm1670_library('frame');
% display image array
figure(1)
status = imshow(uint8(imager));
title(['\bfAgilent ADCM-1670 Camera Module: Frame = ',int2str(frame)])
xlabel('--- PRESS ESC TO EXIT ---')
% increment frame counter
frame = frame + 1;
% allow display to update
pause(1e-3)
% check user input
key = double(get(gcf,'currentcharacter'));
% exit loop?
if (~isempty(key) & (key == 27))
break
end
end
% close figure
close(gcf)
% close communications session
status = adcm1670_library('close');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -