Set pixel format

asked 2015-06-22 06:26:05 -0500

Tanq gravatar image

Hi. I want to know how can i change pixel format for my camera. I'm using unibrain fire-i cameras, opencv 3 on windows with visual studio. When i start capturing from camera, it writes to output window:

SETUP: trying specified format RGB24 @ 640x480

SETUP: trying format RGB24 @ 640x480

SETUP: trying format RGB32 @ 640x480

and so on for these pixel formats: RGB555, RGB565, YUY2, YVYU, YUYV, IYUV, UYVY, YV12, YVU9, Y411, Y41P, Y211, AYUV, MJPG, Y800, Y800, Y800, I420. How can i manually set one of these pixel formats and how can i enumerate which pixel formats camera supports?

This camera that shows this list support only y-mono, but other cameras supports yuv 4:1:1, 4:2:2, 4:4:4, rgb24 and y-mono. Default pixel format is rgb, but with rgb i get only 15fps but other formats supports 30fps.

edit retag flag offensive close merge delete

Comments

Check the manual VideoCapture::set(CV_CAP_PROP_MODE, Backend-specific value indicating the current capture mode). Anyway not all modes are available on all cam

pklab gravatar imagepklab ( 2015-06-26 12:55:49 -0500 )edit

Have you tried something like this:

capture.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'))
zardosht gravatar imagezardosht ( 2019-07-14 07:34:40 -0500 )edit