I'm trying to set the Raspberry Pi Cameras mode using OpenCVs VideoCapture class and setting it's properties with the code below. Setting it to 640x480x30fps works just fine, but 1920x1080x30 fps only delivers 3 or 4 frames per second.
Can anyone tell me what I'm missing? Thanks a lot.
#include <opencv2/core.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp>
int main (){
int height(1080);
int width(1920);
cv::VideoCapture cap(0);
cap.set(CV_CAP_PROP_FRAME_HEIGHT, height);
cap.set(CV_CAP_PROP_FRAME_WIDTH, width);
cap.set(cv::CAP_PROP_FOURCC, 0x21);
cap.set(cv::CAP_PROP_FPS, 30);
cv::Mat currentFrame;
while(1){
cap >> currentFrame;
//do stuff
char c = (char)cv::waitKey(1);
if (c == 27) break;
}
}