opencv操作相机相关函数
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)
opencv操作相机相关函数的更多相关文章
- 使用OpenCV进行相机标定
1. 使用OpenCV进行标定 相机已经有很长一段历史了.但是,伴随着20世纪后期的廉价针孔照相机的问世,它们已经变成我们日常生活的一种常见的存在.不幸的是,这种廉价是由代价的:显著的变形.幸运的是, ...
- day08-Python运维开发基础(文件操作与相关函数、函数基础)
1. 文件操作及相关函数 # ### 文件操作 """ fp = open("文件名称",mode=模式,encoding=编码集) fp 文件io对 ...
- 利用opencv进行相机标定程序
#include "Stafx.h" ; //棋盘上有13个格子,那么角点的数目12 ; ; //图片的总张数 int main(int argc, char** argv) { ...
- 解决OpenCV JavaCameraView相机preview方向问题
网上找了很多解决都是有问题的,研究了半天源码解决了这个问题.我是从整个相机启动和数据传输的过程着手的,这里捡重点介绍一下,最后会贴上修改后的两个源文件. 首先要知道一个概念. 图里的小圆圈是Home按 ...
- OpenCV操作像素
在了解了图像的基础知识和OpenCV的基础知识和操作以后,接下来我们要做的就对像素进行操作,我们知道了图像的本质就是一个矩阵,那么一个矩阵中存储了那么多的像素,我们如何来操作呢?下面通过几个例子来看看 ...
- 【opencv】相机标定程序内存溢出
运行相机内参标定程序出现内存溢出的错误 opencv的alloc.cpp报cv::OutOfMemoryError 因为同时开了多个线程,每个线程标定一台相机,每个线程都会imread读入所有标定图片 ...
- php数据库操作常用相关函数
MySQL访问函数都需要有相应的权限才能运行.常用的相关函数介绍如下: (1)integer mysql_connect(主机,用户名,口令); 此函数开始一个对指定主机上的MySQL数据库的连接.若 ...
- 多线程下OpenCV操作的问题
问题:在OpenCV中,使用cvCaptureFromAVI打开一个视频文件后,并使用cvReleaseCapture释放关闭它后.再开启一个线程使用cvCaptureFromAVI打开一个视频文件, ...
- opencv 操作本地摄像头实现录像
直接上代码: // demo1.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <iostream> usin ...
随机推荐
- 防止ddos攻击
1.防止ddos攻击 :接入层过滤器,去判断非法请求ip地主(如果请求过多,自己加入黑名单),上传至防火墙黑名单,不再录入 2.防止xss/css攻击 :在接入层,有第三方jra包工具类,过滤所有请求
- Your build settings specify a provisioning profile with the UUID, no provisioning profile was
http://blog.csdn.net/rbyyyblog/article/details/12220875 在Archive项目时,出现了“Your build settings specify ...
- C++测试题练习题1
1.which of the following is not automatically generated by the compiler? a. default constructor b ...
- oracle手动修改listener.ora和tnsnames.ora之后竟然无效
oracle手动修改listener.ora和tnsnames.ora之后竟然无效 花式重启都没有生效,需要使用Net Configuration Assistant来进行刷一下,重新生成的监听还是一 ...
- GTD实用指南
以前通过余弦大牛博客接触到了GTD, 后来我自己接触之后呢, 我是非常讨厌GTD的, 因为太功利化了 反人类 我还是比较懒得··· 可是最近事情真的比较多,不得不做GTD了 = = 郁闷! 时间管理 ...
- php hex2bin 物联网设备发送十六进制数据
hex2bin("十六进制字符") 折腾了三天 后来大神一句话搞定 : hex2bin("十六进制字符") 网上有个方向是错误的 就是 "\xAA\x ...
- js:Razor视图下服务器代码给Javascript变量赋值
namespace Razor.Controllers { public class JSController : Controller { public ActionResult Index() { ...
- 代理server的概要知识
技术支持请留言:http://www.lcpower.cn 一.什么是代理server? 代理server英文全称是Proxy Server.其功能就是代理网络用户去取得网络信息.形象的说:它是网络信 ...
- SQLserver字符串分割函数
一.按指定符号分割字符串,返回分割后的元素个数,方法很简单,就是看字符串中存在多少个分隔符号,然后再加一,就是要求的结果.CREATE function Get_StrArrayLength( @s ...
- nginx配置:支持phpfastcgi,nginx和php-cgi通信,部分nginx常量解释
支持phpfastcgi的配置如下: server { listen 8000; server_name localhost; root F:/home/projects/test; index in ...