Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Opencv select timeout at high resolutions

Hi all. I have an A4Tech pk-336e webcam attached with my BeagleBone and i am using OpenCV to capture images from BeagleBone Black. Issue is when i capture image at 320x240 resolution i get a perfect image but at 640x480 i get select timeout. Although it is written on camera that it supports 640x480 when i type the following command

v4l2-ctl --all

My code to capture image is as follows:

#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>

#include <iostream>
#include <stdio.h>

using namespace std;
using namespace cv;

int main( )
{
    cout <<"Start main"<<endl;
    VideoCapture cap(0); // open the default camera
    cap.set(CV_CAP_PROP_FRAME_WIDTH , 640);
    cap.set(CV_CAP_PROP_FRAME_HEIGHT ,480);

    Mat meter_image;
    cap >> meter_image;
    imwrite("/card/imgs.jpg", meter_image);
    return 0;
}

I know its really common issue but i am not sure where i can find the solution as i am able to make it working with Logitech one. Kindly let me know of any thing which helps in solving this... Regards