当前位置:网站首页>Bit by bit of OpenCV calling USB camera
Bit by bit of OpenCV calling USB camera
2022-07-02 14:36:00 【thequitesunshine007】
1 Preface
Most of the cameras used in general projects are industrial cameras , Its manufacturers are equipped with perfect secondary development SDK, Rich interfaces .
But I recently came across a camera , The biggest advantage is that it is cheap ( It is a fraction of the price of the same industrial camera ), Unfortunately, there is no SDK Provide ( only one amcap.exe), This is embarrassing for users .
OpenCV Medium vediocapture Class contains access and control USB Camera functions ( The premise is that the camera itself supports , Not all USB Cameras are supported by vediocapture Direct access ).
2 VideoCapture It takes too long to turn on the camera
If the cv::VideoCapture capture(device_index); Turn on the camera device , The program runs abnormally slowly , Output a large number of loads in the output window pdb Information of symbols , It's probably going to take 30s To successfully open the device , This is obviously maddening .
2.1 The analysis reason
CV_WRAP explicit VideoCapture(int index, int apiPreference = CAP_ANY);
cv::VideoCapture Which background driver is suitable for polling one by one , This traversal is obviously time-consuming .
We didn't specify apiPreference When parameters are , It defaults to traversing one by one , It may be time-consuming .
2.2 terms of settlement
Direct designation apiPreference Parameters , Specify the background used to start the camera API. Can be specified as CAP_DSHOW Or other ( Adjust measures to local conditions ).
cv::VideoCapture capture(device_index, cv::CAP_DSHOW);
The time to turn on the device instantly starts from 30s Reduced to less than 200ms.
3 Exposure time setting
capture.set(cv::CAP_PROP_EXPOSURE, -5);
there -5 What does it mean &#x
边栏推荐
- docker mysql
- OpenCV调用USB摄像头的点滴
- The most complete analysis of Flink frame window function
- There is no solution to the decryption error of the remote user 'sa' and the service master password mapped from the remote server 'to the local user' (null) /sa '
- Fabric. JS upper dash, middle dash (strikethrough), underline
- Default slot, named slot, scope slot
- 【apipost】使用教程
- NLA natural language analysis makes data analysis more intelligent
- STM32标准固件库函数名记忆(二)
- MQ教程 | Exchange(交换机)
猜你喜欢

《可供方案开发》口算训练机/数学宝/儿童口算宝/智能数学宝 LCD液晶显示驱动IC-VK1622(LQFP64封装),原厂技术支持

实现一个多进程并发的服务器

Stm32-dac Experiment & high frequency DAC output test
![[development environment] 010 editor tool (tool download | binary file analysis template template installation | shortcut key viewing and setting)](/img/de/7d70f513577e93f1bde1969935a29e.jpg)
[development environment] 010 editor tool (tool download | binary file analysis template template installation | shortcut key viewing and setting)

taobao.trade.memo.add( 对一笔交易添加备注 )接口,淘宝店铺插旗接口,淘宝订单插旗API接口,oAuth2.0接口

Essential elements of science fiction 3D scenes - City

##51单片机实验之简易验证码发生器

富文本编辑器添加矢量公式(MathType for TinyMCE ,可视化添加)

socket(套接字)与socket地址

The use of TestNG, the testing framework (II): the use of TestNG XML
随机推荐
Chinese science and technology from the Winter Olympics (III): the awakening and evolution of digital people
途家木鸟美团夏日折扣对垒,门槛低就一定香吗?
< schematic diagram of oral arithmetic exercise machine program development> oral arithmetic exercise machine / oral arithmetic treasure / children's math treasure / children's calculator LCD LCD driv
Data Lake (11): Iceberg table data organization and query
Daily learning 2
STM32-DAC实验&高频DAC输出测试
Fabric. JS dynamically set font size
Fabric.js 手动加粗文本iText
The most complete analysis of Flink frame window function
php链表创建和遍历
Fabric. JS free drawing ellipse
YoloV6训练:训练自己数据集遇到的各种问题
[QNX Hypervisor 2.2用户手册]6.3 Guest与外部之间通信
Fabric.js 上划线、中划线(删除线)、下划线
NLA自然语言分析实现数据分析零门槛
[development environment] StarUML tool (download software | StarUML installation | StarUML creation project)
每日学习2
快解析:轻松实现共享上网
Tujia muniao meituan has a discount match in summer. Will it be fragrant if the threshold is low?
Advanced usage of C language -- function pointer: callback function; Conversion table