当前位置:网站首页>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
边栏推荐
- STM32-DAC实验&高频DAC输出测试
- Tencent cloud tstor unified storage passed the evaluation of the first batch of basic file storage capabilities of the ICT Institute
- What is erdma? Popular science cartoon illustration
- 大顶堆、小顶堆与堆排序
- Onnx+tensorrt: write preprocessing operations to onnx and complete TRT deployment
- Development and design of animation surrounding mall sales website based on php+mysql
- Why can't browsers read JSX?
- 跨服务器数据访问的创建链接服务器方法
- [development environment] StarUML tool (download software | StarUML installation | StarUML creation project)
- Check password
猜你喜欢

STM32库函数进行GPIO初始化

<口算练习机 方案开发原理图>口算练习机/口算宝/儿童数学宝/儿童计算器 LCD液晶显示驱动IC-VK1621B,提供技术支持

Fabric. Usage of JS eraser (including recovery function)

Fabric. JS free draw circle

PyQt5_ Qscrollarea content is saved as a picture

途家木鸟美团夏日折扣对垒,门槛低就一定香吗?

Daily learning 2

Fabric. JS zoom canvas

Teamtalk source code analysis win client
![[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)
随机推荐
How many knowledge points can a callable interface have?
Tujia muniao meituan has a discount match in summer. Will it be fragrant if the threshold is low?
Available solution development oral arithmetic training machine / math treasure / children's oral arithmetic treasure / intelligent math treasure LCD LCD driver ic-vk1622 (lqfp64 package), original te
OpenCV调用USB摄像头的点滴
Check password
Understanding of mongodb
Why can't browsers read JSX?
Default slot, named slot, scope slot
Use of swagger
Fabric.js 缩放画布
NLA自然语言分析实现数据分析零门槛
STM32 standard firmware library function name (I)
Methods of software testing
mathML转latex
OpenHarmony笔记-----------(四)
docker mysql
天猫商品详情接口(APP,H5端)
Quick analysis: easy to share the Internet
Development and design of animation surrounding mall sales website based on php+mysql
Certik released the defi security report in 2021, disclosing key data of industry development (PDF download link attached)