Search code examples
c++opencvfullscreen

Why does a full screen window resolution in OpenCV (@ Banana Pi, Raspbian) slow down the camera footage and let it lag?


Currently I’m working on a project to mirror a camera for a blind spot. The camera got 640 x 480 NTSC signal. The output screen is 854 x 480 NTSC. I grab the camera with an EasyCAP video grabber. On the Banana Pi I installed open cv 2.4.9.

The critical point of this project is that the video on the display needs to be real time. Whenever I comment the line that puts the window into fullscreen, there pop ups a small window and the footage runs without delay and lagg. But when I set the video to full screen, the footage becomes slow, and lags.

Part of the code:

namedWindow("window",0);
setWindowProperty("window",CV_WND_PROP_FULLSCREEN,CV_WINDOW_FULLSCREEN);

while(1){
        cap>>image;
        flip(image, destination,1);
        imshow("window",destination);
        waitKey(33); //delay 33 ms
    }

How can I fill the screen with the camera footage without losing speed and frames? Is it possible to output the footage directly to the composite output?


Solution

  • I fixed the whole problem by using: namedWindow("window",1); With FLAG 1 stands for WINDOW_AUTOSIZE. The footage is more real-time now. I’m using a small monitor, so the window size is nearly the same as the monitor.