@[TOC]python opencv相关的Get使用参数解释kinect2摄像头调用参数
1、基础学习内容
#2、加载图像
#3、加载视频
#4、在图像上绘制和写字
#5、图像操作
#6、图像算术和逻辑运算
#7、阈值
#8、颜色过滤
#9、模糊和平滑
#10、形态变换
#11、边缘检测和渐变
读取视频并显示
VideoCapture中get和set常用的19个参数,opencv3中不用输入CV_,2版本中需要CV_
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/capture next:
下一步要解码/捕获的帧的基于0的索引
CV_CAP_PROP_POS_AVI_RATIO:
relative position of the video file :0-start of the film ,
1-end of the film视频文件的相对位置:0-胶片开始,1-胶片结束
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
编解码器的4字符代码
CV_CAP_PROP_FRAME_COUNT:
number of frames in the video file
视频文件中的帧数
CV_CAP_PROP_FORMAT:
format of the mat objects returned by retrieve
检索返回的mat对象的格式
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:
staturation 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
指示是否应将图像转换为rgb的布尔标志
CV_CAP_PROP_WHITE_BALANCE:
currently unsupported
目前不受支持
CV_CAP_PROP_RECTIFICATION:
rectification flag for stereo cameras(note:only supported by DC1394 v2x backend currently)
立体摄像机校正标志(注:目前仅支持DC1394 v2x后端)
‘’'python
import numpy as np
import cv2
cap = cv2.VideoCapture(1)
if cap.isOpened():
width = cap.get(cv2.CAP_PROP_FRAME_WIDTH)
height = cap.get(cv2.CAP_PROP_FRAME_HEIGHT)
print(cap.get(cv2.CAP_PROP_POS_MSEC))#视频文件当前的秒数
print(cap.get(cv2.CAP_PROP_POS_FRAMES))#下一步要捕获解码的基于0的索引
print(cap.get(cv2.CAP_PROP_POS_AVI_RATIO))#视频的相对位置,0开始,1胶片结束
print(cap.get(cv2.CAP_PROP_FPS))#帧数率
print(cap.get(cv2.CAP_PROP_FOURCC))#编码器4字符编码
print(cap.get(cv2.CAP_PROP_FRAME_COUNT))#视频文件中的帧数
print(cap.get(cv2.CAP_PROP_FORMAT))#MAT对象格式
print(cap.get(cv2.CAP_PROP_MODE))#捕获模式后端特定值
print(cap.get(cv2.CAP_PROP_BRIGHTNESS))#图像亮度
print(cap.get(cv2.CAP_PROP_CONTRAST))#图像对比度
print(cap.get(cv2.CAP_PROP_SATURATION))#图像静止度
print(cap.get(cv2.CAP_PROP_HUE))#图像的色调
print(cap.get(cv2.CAP_PROP_GAIN))#图像的增益
print(cap.get(cv2.CAP_PROP_EXPOSURE))#图像的曝光度
print(cap.get(cv2.CAP_PROP_CONVERT_RGB))#是否应将图像转换为rgb不尔标志
print(cap.get(cv2.CAP_PROP_RECTIFICATION))#立体相机矫正标识
print(width,height)
print(type(cap))
cap.release()
cv2.destroyAllWindows()
‘’’
输出:
-1.0
-1.0
-1.0
0.0
-466162819.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
1920.0 1080.0
<class ‘cv2.VideoCapture’>