Can I set the color depth while capturing the webcam image using OpenCV?

后端 未结 2 856
终归单人心
终归单人心 2021-01-22 21:09

I am capturing the image using OpenCV in C++

firstFrame = cvQueryFrame(capture);

it is easy to set the width and height properties by



        
2条回答
  •  被撕碎了的回忆
    2021-01-22 21:41

    Have forked a seperate branch on github, with changes to videoio to support custom streams & formats.

    Git hub repo link

    https://github.com/shawndfernandes/opencv

    Added support for custom stream & depth for opencv capture, reverts to default opencv values if not set.

    Set via VideoWriter::set method

    CV_CAP_PROP_DEPTH

    matrix_depth = 8,16 //* for 8U and 16 for 16U depth

    CV_CAP_PROP_STREAM

    stream_format = 1,2,3,4,5…12; //choose the raw camera stream via V4L

    "BGR24" 1:

    "YVU420" 2:

    "YUV411P" 3:

    "MJPEG" 4:

    "JPEG" 5:

    "YUYV" 6:

    "UYVY" 7:

    "SN9C10X" 8:

    "SBGGR8" 9:

    "SGBRG8" 10:

    "RGB24" 11:

    "Y16" 12:

提交回复
热议问题