• 大小: 6KB
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-06-02
  • 语言: Matlab
  • 标签: MATLAB  相机  

资源简介

这是一个MATLAB GUI,用于链接matlab和相机,并实时获取相机图像,进行处理。你需要一个gige的支持插件,来实现功能。

资源截图

代码片段和文件信息

function varargout = CameraMonitoringSpotPosition(varargin)

%% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name‘       mfilename ...
                   ‘gui_Singleton‘  gui_Singleton ...
                   ‘gui_OpeningFcn‘ @CameraMonitoringSpotPosition_OpeningFcn ...
                   ‘gui_OutputFcn‘  @CameraMonitoringSpotPosition_OutputFcn ...
                   ‘gui_LayoutFcn‘  []  ...
                   ‘gui_Callback‘   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State varargin{:});
else
    gui_mainfcn(gui_State varargin{:});
end
% End initialization code - DO NOT EDIT


%% --- Executes just before CameraMonitoringSpotPosition is made visible.
function CameraMonitoringSpotPosition_OpeningFcn(hobject eventdata handles varargin)
% This function has no output args see OutputFcn.
% hobject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to CameraMonitoringSpotPosition (see VARARGIN)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
handles.vid=videoinput(‘gige‘1‘Mono10‘);   % Construct video input object vid
handles.vidRes=handles.vid.VideoResolution;    % Get resolution
handles.src=getselectedsource(handles.vid);

% Choose default command line output for CameraMonitoringSpotPosition
handles.output = hobject;

% Update handles structure
guidata(hobject handles);

% UIWAIT makes CameraMonitoringSpotPosition wait for user response (see UIRESUME)
% uiwait(handles.figure1);


%% --- Outputs from this function are returned to the command line.
function varargout = CameraMonitoringSpotPosition_OutputFcn(hobject eventdata handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hobject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


function VerticalOffset_Callback(hobject eventdata handles)
% hobject    handle to VerticalOffset (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


%% --- Executes during object creation after setting all properties.
function VerticalOffset_CreateFcn(hobject eventdata handles)
% hobject    handle to VerticalOffset (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hobject‘BackgroundColor‘) get(0‘defaultUicontrolBackgroundColor‘))
    set(hobject‘Background

评论

共有 条评论