首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何获取视频采集设备的信息?

如何获取视频采集设备的信息?
EN

Stack Overflow用户
提问于 2014-07-08 11:03:39
回答 1查看 2.6K关注 0票数 1

我需要从C++代码中查询连接视频采集设备(主要是摄像头)的设备信息。这些信息应该包含至少帧速率,输出格式和控制值(颜色调整).

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-07-08 11:20:32

Opencv的视频拍摄::get(Int propId)可以获得以下信息

代码语言:javascript
复制
CV_CAP_PROP_POS_MSEC      Current position of the video file in milliseconds or video capture timestamp.
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 Currently not supported
CV_CAP_PROP_RECTIFICATION Rectification flag for stereo cameras (note: only supported by DC1394 v 2.x backend currently)

例如:

代码语言:javascript
复制
VideoCapture cap(0); // open the default camera
if(!cap.isOpened())  // check it exists
    return -1;
double fps = cap.get(CV_CAP_PROP_FPS);
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24630158

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档