简体   繁体   中英

Pi Camera with v4l2 OpenCv - can't get 2592x1944 Resolution

I am using pi camera v1 (5 MP) on raspberry pi3 with v4l2 driver. When I use the commands below, it captures 5 MP image but I can't get the same image when I capture it from OpenCV. Captured image from OpenCV is always 480x480.

sudo modprobe bcm2835-v4l2 max_video_width=2592 max_video_height=1944
v4l2-ctl --set-fmt-video=width=2592,height=1944,pixelformat=MJPG
v4l2-ctl -p 15
v4l2-ctl --stream-mmap=3 --stream-count=1 --stream-to=somefile.mjpeg

What can I do to change the resolution to 5 MP in OpenCV ?

I am not sure what you have tried, but one way to specify the resolution is:

cv::VideoCapture cap;
cap.set(CV_CAP_PROP_FRAME_WIDTH, 2592);
cap.set(CV_CAP_PROP_FRAME_HEIGHT, 1944);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM