1、基本操作

capture = cv2.VideoCapture(0)
ret, image = capture.read()
cv2.imwrite("photo.jpg", image)
capture.release()

2、相机属性设置(读、写)

set:

cv2.VideoCapture.set(propId, value) → retval

cv.SetCaptureProperty(capture, property_id, value) → retval

get:

  propId –

    

  • CV_CAP_PROP_POS_MSEC Current position of the video file in milliseconds.
  • CV_CAP_PROP_POS_FRAMES 0-based index of the frame to be decoded/captured next.
  • CV_CAP_PROP_POS_AVI_RATIO Relative position of the video file: 0 - start of the film, 1 - end of the film.
  • CV_CAP_PROP_FRAME_WIDTH Width of the frames in the video stream.
  • CV_CAP_PROP_FRAME_HEIGHT Height of the frames in the video stream.
  • CV_CAP_PROP_FPS Frame rate.
  • CV_CAP_PROP_FOURCC 4-character code of codec.
  • CV_CAP_PROP_FRAME_COUNT Number of frames in the video file.
  • CV_CAP_PROP_FORMAT Format of the Mat objects returned by retrieve() .
  • CV_CAP_PROP_MODE Backend-specific value indicating the current capture mode.
  • CV_CAP_PROP_BRIGHTNESS Brightness of the image (only for cameras).
  • CV_CAP_PROP_CONTRAST Contrast of the image (only for cameras).
  • CV_CAP_PROP_SATURATION Saturation of the image (only for cameras).
  • CV_CAP_PROP_HUE Hue of the image (only for cameras).
  • CV_CAP_PROP_GAIN Gain of the image (only for cameras).
  • CV_CAP_PROP_EXPOSURE Exposure (only for cameras).
  • CV_CAP_PROP_CONVERT_RGB Boolean flags indicating whether images should be converted to RGB.
  • CV_CAP_PROP_WHITE_BALANCE_U The U value of the whitebalance setting (note: only supported by DC1394 v 2.x backend currently)
  • CV_CAP_PROP_WHITE_BALANCE_V The V value of the whitebalance setting (note: only supported by DC1394 v 2.x backend currently)
  • CV_CAP_PROP_RECTIFICATION Rectification flag for stereo cameras (note: only supported by DC1394 v 2.x backend currently)
  • CV_CAP_PROP_ISO_SPEED The ISO speed of the camera (note: only supported by DC1394 v 2.x backend currently)
  • CV_CAP_PROP_BUFFERSIZE Amount of frames stored in internal buffer memory (note: only supported by DC1394 v 2.x backend currently)

最新文章

  1. Open xml 操作Excel 透视表(Pivot table)-- 实现Excel多语言报表
  2. Spring源码分析——BeanFactory体系之抽象类、类分析(二)
  3. windows程序里新窗体不在任务栏显示,无标题拖动,键盘事件,始终显示在主窗体上面,单实例运行等
  4. ArcGIS 投影转换(AE)
  5. ios关于layer的一些常用属性
  6. C语言细节总结笔记
  7. 解决Jenkins上git出现的“ERROR: Error fetching remote repo 'origin'”问题
  8. linux input如何固定设备event handler
  9. 第一章 开发简单Java应用程序
  10. java调用kettle的job和transfer工具类
  11. Android开发学习之路--逆向分析反编译
  12. JS设计模式之单例模式
  13. Java面试题系列(四)强引用、软引用、弱引用、幻象引用有什么区别?
  14. python学习记录(一)
  15. java给时间格式化
  16. 《DSP using MATLAB》Problem 5.5
  17. 图片MassiGra045 简体中文|MG
  18. javascript基础拾遗(十)
  19. 手机端网页使用html5地理定位获取位置失败的解决办法
  20. Eclipse配置C++环境

热门文章

  1. Blocks编程要点
  2. [置顶] pycurl检测网站性能,pycurl.*_TIME时间问题
  3. MyEclipse Html自动提示功能的设置方法
  4. HDU1421
  5. 2016.6.20 maven更改repository的位置
  6. 【日常学习】【并查集+map】codevs2639 约会计划题解
  7. Notepad2替换记事本--映像劫持
  8. jQuery与ajax的应用(一)
  9. 性能测试框架Multi-Mechanize安装与使用
  10. syslog,rsyslog and syslog-ng