matlab打开笔记本摄像头_matlab窗口调用摄像头

更改”.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);

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/476179.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

session过期后登陆页面跳出iframe页面问题

登陆页面增加javascript:function window.onload(){if(window.parent.length>0)window.parent.locationlocation;}转载于:https://www.cnblogs.com/shenyunjun420/archive/2009/09/29/1576400.html

LeetCode 1143. 最长公共子序列(动态规划)

1. 题目 给定两个字符串 text1 和 text2,返回这两个字符串的最长公共子序列的长度。 一个字符串的 子序列 是指这样一个新的字符串:它是由原字符串在不改变字符的相对顺序的情况下删除某些字符(也可以不删除任何字符)后组成的新…

【DKN】(四)train.py

内容 try: #不用多言, 获得该模块下的model_name函数Model getattr(importlib.import_module(f"model.{model_name}"), model_name)config getattr(importlib.import_module(config), f"{model_name}Config") except AttributeError:print(…

用promise封装ajax_ES6-promise封装AJAX请求

【摘要】ES6-promise封装AJAX请求考必过小编为大家整理了关于ES6-promise封装AJAX请求的信息,希望可以帮助到大家!ES6-promise封装AJAX请求标签:const状态码setreject对象响应状态ISErequest// 接口地址:https://api.apiopen.top/getJoke// 1…

REST和SOAP Web Service的比较(写得非常清晰易懂,转载于此)

本文转载自他人的博客,ArcGIS Server 推出了 对 SOAP 和 REST两种接口(用接口类型也许并不准确)类型的支持,本文非常清晰的比较了SOAP和Rest的区别联系!REST似乎在一夜间兴起了,这可能引起一些争议,反对者可…

LeetCode 1249. 移除无效的括号(栈+set / deque)

1. 题目 给你一个由 (、) 和小写字母组成的字符串 s。 你需要从字符串中删除最少数目的 ‘(’ 或者 ‘)’ (可以删除任意位置的括号),使得剩下的「括号字符串」有效。 请返回任意一个合法字符串。 有效「括号字符串」应当符合以下 任意一条 要求&…

【DKN】(七)dataset.py【未完】

内容 里面有的函数在这里https://blog.csdn.net/qq_35222729/article/details/119882362 try:config getattr(importlib.import_module(config), f"{model_name}Config") except AttributeError:print(f"{model_name} not included!")exit()class BaseDa…

php raabitmq中间件_rabbitMQ消息中间件环境配置及原理了解

视频教程一、Docker 入门Docker是什么?Docker 是一个开源的应用容器引擎,你可以将其理解为一个轻量级的虚拟机,开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任 何流行的 Linux 机器上。为什么要使用 Docke…

CSS 中的定位:relative,absolute

今天碰到一个定位问题,问题解决不好,于是花了大量的时间,调试了好久,得出了一些结果:1、如果有两个不交叉的盒子位于一个大盒子里面,位于上边的盒子的定位为relative,而下边的那个盒子的定位则是…

【DKN】(六)KCNN.py

内容 import torch import torch.nn as nn import torch.nn.functional as F from src.model.general.attention.additive import AdditiveAttentiondevice torch.device("cuda:0" if torch.cuda.is_available() else "cpu")class KCNN(torch.nn.Module):…

北京精雕现状_6秒精密加工,日本走下神坛,北京精雕也做了一个!

各位社友还记得吗,机械社区之前分享过——日本6秒的精密加工火遍制造业圈子~▲点击上图 查看日本怎么用6s让世界惊奇在一阵惊呼赞叹中,一部分人也表示不服!比如,国内一位牛人也展示了他的产品。一起看看视频介绍吧——而近日&…

LeetCode 859. 亲密字符串

1. 题目 给定两个由小写字母构成的字符串 A 和 B ,只要我们可以通过交换 A 中的两个字母得到与 B 相等的结果,就返回 true ;否则返回 false 。 示例 1: 输入: A "ab", B "ba" 输出&#xff1a…

ASP.Net快速开发新闻系统 在线播放

http://www.so138.com/sov/d19a5913-88cf-4abf-a487-69293bb0c403.html转载于:https://www.cnblogs.com/freedom831215/archive/2009/10/03/1577631.html

【DKN】(五)attention.py

感觉还是挺简单,这里只是方便之后回来瞅瞅 import torch import torch.nn as nn import torch.nn.functional as Fclass Attention(torch.nn.Module):"""Attention Net.Input embedding vectors (produced by KCNN) of a candidate news and all of…

小米扫地机器人充电座指示灯不亮_小米扫地机器人常见问题处理 充电后无法取电怎么办?...

与其他科技领域一样,人工智能领域也得到蓬勃发展。如今人工智能已经无处不在。专家把人工智能比作电力,因为它是一种可能改变各行各业的资源。诚然,每个领域都有一些特别重要的技术,例如随着生活的水平的提高,扫地机器…

Enterprise Library 4.1 快速上手(图)

简介: 关于Enterprise Library 的概念,网上可以很容易的找到,在这里要做的是如何快速的打通Enterprise Library 4.1的使用, 让咱们可以用最短的时间使用起来,并且在需要的时候在此基础上再花时间延伸,这是学…

知识图谱源码详解【八】__init__.py

import torch from src.model.DKN.KCNN import KCNN from src.model.DKN.attention import Attention from src.model.general.click_predictor.DNN import DNNClickPredictor# 就是把整个模型框架梳理到一块了! class DKN(torch.nn.Module):"""Deep…

python complex函数def_【Python3】Python函数

1. 函数对象函数是第一类对象,即函数可以当做数据传递可以被引用可以当做参数传递返回值可以是函数可以当做容器类型的元素def foo():print(from foo)def index():print(from index)dic {foo:foo,index:index,}while True:choice input(">>>>>…

追MM与设计模式的有趣见解

Posted on 2007-01-18 12:53 东人EP 阅读(383) 评论(0) 编辑 收藏 引用 所属分类: Design Pattern 追MM与设计模式的有趣见解 创建型模式 1、FACTORY —追MM少不了请吃饭了,麦当劳的鸡翅和肯德基的鸡翅都是MM爱吃的东西,虽然口味有所不同,…

LeetCode 872. 叶子相似的树

1. 题目 请考虑一颗二叉树上所有的叶子,这些叶子的值按从左到右的顺序排列形成一个 叶值序列 。 举个例子,如上图所示,给定一颗叶值序列为 (6, 7, 4, 9, 8) 的树。 如果有两颗二叉树的叶值序列是相同,那么我们就认为它们是 叶…