当前位置:网站首页>Day (10) of picking up matlab
Day (10) of picking up matlab
2022-04-23 15:55:00 【Sola_ Ex】
Pick up MATLAB Day 10 of
Matlab Camera photo acquisition
Camera on code
The statement that the camera is turned on :
obj =videoinput('DeviceName',1,'YUY2_640*480');
-
DeviceName Is your available audio and video input device .
-
“1” Represents an open device .
-
YUY2_640*480 Represents a format .
Format configuration
set(obj,'ReturnedColorSpace','rgb')
The configuration format is RGB Format .
preview(obj);
Get images
getphoto = getsnapshot(obj);
filename = int2str(1);
filename = [filename,'jpg']
inwrite(getphoto,filename);
Turn off the camera
stop(obj);
closepreview(obj);
delete(obj);
clear;
About the problem
1、 Use obj =videoinput(‘DeviceName’,1,‘YUY2_640*480’); after
Misuse videoinput (line 217)
Invalid ADAPTORNAME specified. Type ‘imaqhwinfo’ for a list of available ADAPTORNAMEs. Image acquisition adaptors may be available as downloadable support packages. Open Support
Package Installer to install additional vendors.
The reason for this problem may be that you use DeviceName incorrect , Or installed Matlab The version is missing a plug-in . So first find the corresponding device name , Use :
info=imaqhwinfo
A message will appear :
info =
InstalledAdaptors: {
}
MATLABVersion: '8.3 (R2014a)'
ToolboxName: 'Image Acquisition Toolbox'
ToolboxVersion: '4.7 (R2014a)'
stay InstalledAdaptors There should have been the name of the device , But now there is no , The proof is actually due to the lack of plug-ins . So look at the error prompt above again ,
Support Package Installer
This sentence is underlined , Click on it , The plug-in download interface will appear , Download and install . Finally, you can see the equipment when running
info =
InstalledAdaptors: {
'dcam'}
MATLABVersion: '8.3 (R2014a)'
ToolboxName: 'Image Acquisition Toolbox'
ToolboxVersion: '4.7 (R2014a)'
My device name is dcam
Finally, a camera 0.5s The code for taking an image :
clear;
clc;
obj =videoinput('winvideo',1);
set(obj,'ReturnedColorSpace','rgb');
preview(obj);
for i=1:10
getphoto = getsnapshot(obj);
filename = int2str(i);
filename = [filename,'.jpg']
imwrite(getphoto,filename);
pause(0.5);
end
stop(obj);
closepreview(obj);
delete(obj);
clear;
版权声明
本文为[Sola_ Ex]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231554163874.html
边栏推荐
- 字符串最后一个单词的长度
- shell_ two
- mysql乐观锁解决并发冲突
- PHP function
- matplotlib教程05---操作图像
- 糖尿病眼底病变综述概要记录
- s16. One click installation of containerd script based on image warehouse
- MySQL Cluster Mode and application scenario
- 多级缓存使用
- API IX JWT auth plug-in has an error. Risk announcement of information disclosure in response (cve-2022-29266)
猜你喜欢

MySQL集群模式与应用场景

捡起MATLAB的第(6)天

MySQL optimistic lock to solve concurrency conflict

一文掌握vscode远程gdb调试

APISIX jwt-auth 插件存在错误响应中泄露信息的风险公告(CVE-2022-29266)

5 minutes, turn your excel into an online database, the magic cube net table Excel database

Filter usage of spark operator

时序模型:长短期记忆网络(LSTM)

腾讯Offer已拿,这99道算法高频面试题别漏了,80%都败在算法上

MySQL - execution process of MySQL query statement
随机推荐
MySQL - MySQL查询语句的执行过程
Intersection, union and difference sets of spark operators
一刷313-剑指 Offer 06. 从尾到头打印链表(e)
Deletes the least frequently occurring character in the string
MySQL optimistic lock to solve concurrency conflict
Use bitnami PostgreSQL docker image to quickly set up stream replication clusters
Codejock Suite Pro v20.3.0
ESP32编译环境的搭建
Merging of Shanzhai version [i]
leetcode-396 旋转函数
gps北斗高精度卫星时间同步系统应用案例
Import address table analysis (calculated according to the library file name: number of imported functions, function serial number and function name)
提取不重复的整数
Interview questions of a blue team of Beijing Information Protection Network
捡起MATLAB的第(7)天
保姆级Anaconda安装教程
CAP定理
matplotlib教程05---操作图像
TIA博图——基本操作
s16.基于镜像仓库一键安装containerd脚本