Ask Your Question

refuzee's profile - activity

2013-09-17 06:12:23 -0600 commented answer Making a window full screen keeping aspect ratio

hi tsuyoshi, can you post your solution ?

2013-09-12 05:03:04 -0600 received badge  Supporter (source)
2013-09-12 04:51:45 -0600 answered a question Structured light

a good research area is the kinect and the patents of prime sense as the kinect uses structured light coding.

2013-09-09 11:08:56 -0600 commented question cvWaitKey() slows down capture/display process

to update my display ?

2013-09-09 10:50:38 -0600 asked a question cvWaitKey() slows down capture/display process

Hi,

I am using openCV to capture, display and save frames from ps3 eye camera. with 640x480 i could get 60fps but turns out that i only get about 16 when trying to display and save images at the same time. so i measured a bit and the main contributor to this slow process is cvWaitKey(). Is there any workaround ? here is the code for my loop:

// image capturing loop
    while(_running)
    {
        //activate cvWaitKey - this drops framerate significantly!
        cvWaitKey(1);

        //get frame from capture and put into buffer
        CLEyeCameraGetFrame(_cam, pCapBuffer);

        //get system timestamps 
        GetSystemTime(&st);
        GetLocalTime(&lt);

        // Resize image to fit screen size
        cvResize(pCapImage,resizedpCapImage,CV_INTER_NN);

        //display image
        cvShowImage(_windowName, resizedpCapImage);

        //clear string
        sstm.str(std::string());

        //complete filname      
        sstm << _folder << prefix << _participant << std::setfill('0') << std::setw(10) << i  << "-" << st.wHour << st.wMinute << st.wSecond <<  st.wMilliseconds << suffix;
        image_name = sstm.str();
        c = image_name.c_str();


        //log if enabled
        if (_logging){
            //try to save image
            try {
                cvSaveImage(c, pCapImage); //bmp = speed!
            }
            catch (runtime_error& ex) {
                fprintf(stderr, "Exception converting image to bmp format: %s\n", ex.what());
            }
        }
    }