更改”.m“文件:

function varargout = untitled1(varargin)

% UNTITLED1 MATLAB code for untitled1.fig

%      UNTITLED1, by itself, creates a new UNTITLED1 or raises the existing

%      singleton*.

%

%      H = UNTITLED1 returns the handle to a new UNTITLED1 or the handle to

%      the existing singleton*.

%

%      UNTITLED1('CALLBACK',hObject,eventData,handles,...) calls the local

%      function named CALLBACK in UNTITLED1.M with the given input arguments.

%

%      UNTITLED1('Property','Value',...) creates a new UNTITLED1 or raises the

%      existing singleton*.  Starting from the left, property value pairs are

%      applied to the GUI before untitled1_OpeningFcn gets called.  An

%      unrecognized property name or invalid value makes property application

%      stop.  All inputs are passed to untitled1_OpeningFcn via varargin.

%

%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one

%      instance to run (singleton)".

%

% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help untitled1

% Last Modified by GUIDE v2.5 12-Mar-2015 20:53:43

% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;

gui_State = struct('gui_Name',       mfilename, ...

'gui_Singleton',  gui_Singleton, ...

'gui_OpeningFcn', @untitled1_OpeningFcn, ...

'gui_OutputFcn',  @untitled1_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 untitled1 is made visible.

function untitled1_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 untitled1 (see VARARGIN)

% Choose default command line output for untitled1

handles.output = hObject;

% Update handles structure

guidata(hObject, handles);

% UIWAIT makes untitled1 wait for user response (see UIRESUME)

% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = untitled1_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;

global vid;

vid = videoinput('winvideo');

%set(vid,'ReturnedColorSpace','grayscale');

function pushbutton1_Callback(hObject, eventdata, handles)

axes(handles.axes1);

global vid;

vidRes = vid.VideoResolution;

nBands = vid.NumberOfBands;

hImage = image( zeros(vidRes(2), vidRes(1), nBands) );

preview(vid, hImage);

% --- Executes on button press in pushbutton2.

function pushbutton2_Callback(hObject, eventdata, handles)

% hObject    handle to pushbutton2 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

axes(handles.axes2);

global vid;

f=getsnapshot(vid);

imshow(f);

matlab打开笔记本摄像头_matlab窗口调用摄像头相关推荐

  1. matlab打开笔记本摄像头_基于MATLAB调用电脑摄像头获取视频和图像

    clear all; h=waitbar(0.1,'请等待');%waitbar的作用是打开或者更新进度条 h = waitbar(x,'message')x表示进度条的比例长度,message是在进 ...

  2. matlab打开笔记本摄像头_matlab-调用摄像头人脸识别

    ----------------------------边学边写边学习------------------------------------- 版本:2014a 调用摄像头 a = imaqhwin ...

  3. android调用相册和摄像头,Android8.3调用摄像头和相册

    我们平时在使用QQ或微信的时候经常要和别人分享图片,这些图片可以是用手机摄像头拍的,也可以是从相册中选取的.类似这样的功能实在是太常见了,几乎在每个应用程序中都会有,那么本节我们就学习一下调用摄像头和 ...

  4. android摄像头代码,android: 调用摄像头拍照(示例代码)

    intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri); startActivityForResult(intent, CROP_PHOTO); //启动 ...

  5. html调用摄像头直播,html5调用摄像头功能的实现代码

    前言 前些天,线上笔试的时候,发现需要浏览器同意开启摄像头,感觉像是 js 调用的,由于当时笔试,也就没想到这么多问题.今天闲来无事,看了下自己的 todo,发现有这个调用摄像头的todo,才想到

  6. 在Jetson Nano上挂载摄像头并用OpenCV调用摄像头(较详细)

    --前言 我的摄像头为乐视的USB口摄像头,板子为Jetson Nano 4GB的板子 将摄像头接在Jetson Nano板子上,开机板子. 由于我之前已经实现Jetson Nano的内网穿透,故此处 ...

  7. 【双目相机】python使用双目摄像头录像、调用摄像头、调用视频

    1.调用摄像头 #读取摄像头 import cv2 cap=cv2.VideoCapture(0) #cap=cv2.VideoCapture('output.avi') if not cap.isO ...

  8. 服务器项目前端调用摄像头失败,浏览器调用摄像头失败:NotSupportedError Only secure origins are allowed...

    通过浏览器调用摄像头失败:NotSupportedError Only secure origins are allowed 错误报告 NotSupportedError Only secure or ...

  9. vue中如何调用ios摄像头_vue2.0调用摄像头步骤详解

    这次给大家带来vue2.0调用摄像头步骤详解,使用vue2.0调用摄像头的注意事项有哪些,下面就是实战案例,一起来看一下. 可以在github 上下载demo链接 vue组件代码 import {Ex ...

最新文章

  1. DevExpress最强干货|实用示例、更新等你来体验!
  2. 【转载】Linux下套接字学习
  3. 企业应用开发平台-GAP平台
  4. 组数总和—leetcode39
  5. 第八讲:tapestry组件
  6. Min_25 筛小结
  7. Bash:字符串操作
  8. Ui学习笔记---EasyUI的介绍
  9. Weka开发[8]-ID3源码介绍
  10. APMServ5.2.6win10系统Apache、MySQL5.1启动失败解决办法
  11. Android10.0编译 make api-stubs-docs-update-current-api问题
  12. 一碗泡面背后的努力,康师傅连续十次斩获“食安管理十强企业”
  13. pyqt5中利用搜索框和按钮,搜索表中内容
  14. BZOJ 2708 木偶
  15. 20120814-虚拟串口VSPD的使用方法
  16. CSDN电子书PC端上线:打造高效阅读、助力问题解决
  17. S-属性定义与L-属性定义
  18. GF1WFV数据预处理
  19. IPv4与IPv6有什么不同,如何升级到IPv6
  20. 【转】手把手教你绘制精美信息图

热门文章

  1. P1372 又是毕业季I
  2. RBAC 基于角色的访问控制
  3. Python学习札记(十三) Function3 函数参数二
  4. C语言进行CGI程序设计
  5. PHP输出Excel实例代码
  6. [Ubuntu]Apt-get命令参数详解
  7. C语言-数组a 和a 的区别
  8. Linux内存管理(最透彻的一篇)
  9. linux模块加载和模块卸载时出现的问题
  10. oci mysql_Oracle常用的OCI函数