博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
opencv操作相机相关函数
阅读量:6892 次
发布时间:2019-06-27

本文共 2035 字,大约阅读时间需要 6 分钟。

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)

 

转载于:https://www.cnblogs.com/lulu147/p/4914044.html

你可能感兴趣的文章
LeetCode 之 JavaScript 解答第239题 —— 滑动窗口最大值(Sliding Window Maximum)
查看>>
一个项目带你走进产品经理的世界(2)需求分析
查看>>
css经典布局——圣杯布局
查看>>
Java基础系列五
查看>>
css3常用属性总结(1)
查看>>
SQLServer之创建索引视图
查看>>
面试集锦(六)数据结构(2)
查看>>
VimWiki的一些技巧
查看>>
GMQT全球通用积分重磅推出
查看>>
spring cloud构建互联网分布式微服务云平台-路由网关(zuul)
查看>>
Parasoft dotTEST(10.4.1)更新亮点——在.NET应用程序中构建安全性
查看>>
混沌工程究竟用来解决什么问题?
查看>>
如何写好一片文章
查看>>
vue项目前后端实现
查看>>
BCH升级日期将至,社区组织开始为11月“硬分叉”做准备
查看>>
2018最新版直播系统源码:功能和步骤详解
查看>>
没错,我就是要吹爆Angular
查看>>
Andoid屏幕适配终极手段(小编用过最得劲的dp适配)
查看>>
一张图带你了解Aspose 2019年的产品线
查看>>
一篇关于MySQL server层执行查询语句的注释,非常棒
查看>>