RPi3: qtcreator + openCV --> unwanted image field in HDMI screen

asked 2017-06-21 13:01:46 -0600

image description

I am experimenting on some RPI3 (rasbian) applications (e.g. pupil detection and measurement) using OpenCV and QtCreator as IDE. Most of my endeavours work quit well, but there is some strange effect. Some code for testing (code was found somewhere in WWW):

cv::VideoCapture Camera;
cv::Mat image;
Camera.set( CV_CAP_PROP_FRAME_WIDTH, 320 );     //set camera params
Camera.set( CV_CAP_PROP_FRAME_HEIGHT, 240 );
Camera.set( CV_CAP_PROP_FORMAT, CV_8UC1 );
Camera.set( CV_CAP_PROP_FPS, 25 );
if (!Camera.open(0)) qDebug() << "Error opening the camera";
for (;;)
{
    Camera.grab();
    Camera.retrieve(image);
    cv::imshow("Test", image);
    if(cv::waitKey(27) > 0) break;      // close if key pressed
}
Camera.release();
cv::destroyAllWindows();

On the HDMI-screen of my RaspberryPi now there are TWO image fields: one because of “imgshow” (which is intended) and another field which is unwanted (see image enclosed) and I don’t know how to get rid of. Watching the screen over VNC does not display the second unwanted image field.

Has anybody an idea, how to eliminate the second field and/or how is it caused?

Thank you

edit retag flag offensive close merge delete