Can't acquire maximum FPS in ubuntu
Dear all, I am using Logitech C270 webcam in ubuntu, and I need maximum fps for track an object. Although I can acquire 30 fps video using guvcview software in ubuntu, in OpenCV I got only 15 fps. But sometimes in openCV I got 30 fps without changing any capture settings, but mostly it is 15 fps.
Any help will be really appreciated, Thanks.
include <cv.h>
include <highgui.h>
define WIDTH 640
define HEIGHT 480
using namespace cv;
// Global variables for inputs
VideoCapture cap(1);
// set capture properties.
void initInput() { cap.set(CV_CAP_PROP_FRAME_WIDTH, WIDTH); cap.set(CV_CAP_PROP_FRAME_HEIGHT, HEIGHT); cap.set(CV_CAP_PROP_FPS, 30);
}
int main(int argc, char** argv) {
initInput();
if (!cap.isOpened())
return;
namedWindow("input", 1);
while (1) {
cap >> frame;
imshow("input", frame);
//detectPuck(&frame);
if (waitKey(1) >= 0);
//break;
}
return 0;
}
Code please, it is the ONLY way of analyzing what your are doing. Are you using a detector? The complexity of each image will then define how much FPS you can process....