Opencv Timeout error in windows

asked 2016-01-21 22:15:26 -0600

Saran gravatar image

updated 2016-01-22 04:31:26 -0600

Hi, I am streaming from a customized camera device using Opencv c++, I got timeout error when grabbing a frame. Actual Camera setup is like FPGA -> Cypress controller -> host. Currently no Sensor is connected. The FPGA is programmed like that, it will work for 640 x 480 resolution raw data(YUY2). I can able to view the packets received at the host side with the help of Device Monitoring Studio. But in OpenCv It is throwing timeout error. Can anyone help me to resolve this issue.

My code for capturing

int main()
{
    VideoCapture cap;
    char keypressed;

    cap.open(0);

   if (!cap.isOpened())
    {
        cout << "***Could not initialize capturing...***\n";
        return -1;
    }

    for (;;)
    {

        cap.read(InputFrame);
        if (InputFrame.empty()){
            cout << "\n***Frame Empty error***";
        }
        else
        {

            //resizeWindow(" Output Window ", 640, 480);
            imshow(" Output Window ", InputFrame);
        }


        keypressed = (char)waitKey(1);

        //Break when user presses ESC key
        if (keypressed == 27)
            break;

    }

If you need more clarification please feel free to ask.

edit retag flag offensive close merge delete

Comments

you'll probably have to explain, how you're trying to access your camera from opencv

berak gravatar imageberak ( 2016-01-22 01:20:18 -0600 )edit

If you want to add extra info, please use the EDIT button!

StevenPuttemans gravatar imageStevenPuttemans ( 2016-01-22 04:32:17 -0600 )edit

Hi, I tried with Cypress development board, after flashing the firmware it will enumerate as a video device. It doesn't has an FPGA, The GPIF is left opened, as it is opened it will send "FF" data , In the host side i tried wit 640 x 480, but it's timeout error. when i tried with 100 x 80, I can able to view Raw data and when i plot the data i got white image of 100 x 80 resolution.

Saran gravatar imageSaran ( 2016-01-22 04:55:22 -0600 )edit