Ask Your Question

djme's profile - activity

2019-10-14 08:23:04 -0500 received badge  Popular Question (source)
2016-04-03 08:55:12 -0500 commented answer OpenCV On Raspberry Pi2: Camera Resolution

Thanks kbami. I set the image width as 1920 and the image height as 1080 and this worked fine!

2016-04-03 08:54:22 -0500 received badge  Scholar (source)
2016-04-03 08:54:14 -0500 received badge  Supporter (source)
2016-03-30 12:47:23 -0500 asked a question OpenCV On Raspberry Pi2: Camera Resolution

Hi Folks, I asked this question a few days ago on the Raspberry Pi forums but have yet to receive a reply so I am hoping that there might be more expertise on the OpenCV forums to help.

I recently compiled/installed opencv 3.1 on my RPi2 and it works just fine. I had to do a bit of searching to find out how to activate the pi camera to get OpenCV to see it (by basically entering "sudo modprobe bcm2835-v4l2" into the terminal) but the only limitation I now have is that OpenCV commands to modify the camera resolution do not work. The camera is works perfectly fine with OpenCV but the resolution remains fixed at 640x480 despite attempts to change it with OpenCV code (the resolution can not be increased or even decreased).

For example:

std::cout<<cap.get(cv::CAP_PROP_FRAME_WIDTH)<<std::endl; //output: 640
cap.set(cv::CAP_PROP_FRAME_WIDTH, 1080); //does not work
std::cout<<cap.get(cv::CAP_PROP_FRAME_WIDTH)<<std::endl; //output is still 640

Does anyone know how to get the camera/V4L driver to respond to OpenCV calls to change the camera resolution? The camera has a "CSi" interface and can be viewed on Amazon:

Thanks, Djme.