Can't acquire maximum FPS in ubuntu

asked 2014-07-24 09:53:12 -0600

dinesh_sl gravatar image

updated 2014-07-30 03:31:24 -0600

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 &gt;&gt; frame;
    imshow("input", frame);
    //detectPuck(&amp;frame);

    if (waitKey(1) &gt;= 0);
        //break;

}
return 0;

}
edit retag flag offensive close merge delete

Comments

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....

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-25 04:30:00 -0600 )edit