Open CV window orientation is wrong for vertical monitors

asked 2017-12-20 20:53:16 -0600

abhi0329 gravatar image

updated 2017-12-21 10:35:57 -0600

Hi, I am facing an issue with OpenCv window on vertical monitor(by rotating my ubuntu desktop by 90*), OpenCv window is always horizontal (I am using the following code) and not fitting in vertical monitor, the window width is more and height is very less and both top and bottom of window is filled with white border and with image in centre.

cvNamedWindow("xyz", 0); cvSetWindowProperty("xyz", CV_WND_PROP_FULLSCREEN, CV_WINDOW_FULLSCREEN);

Is there any way to achieve the full screen on the vertical screen.C:\fakepath\screenshot.png

edit retag flag offensive close merge delete

Comments

we need to know: opencv version ? gui toolkit used ? exact os version ?

btw, it won't make any difference, but you should NOT use deprecated c-api functions like cvNamedWindow, but their c++ counterparts, like cv::namedWindow

berak gravatar imageberak ( 2017-12-20 21:17:37 -0600 )edit

Thanks, Berak, I have changed the code to use c++ api but its same...I have attached the screenshot for your reference.. Opencv version 3.1 (or more) ... Ubuntu 14.04 LTS..

Dell Laptop Graphics: IntelĀ® Haswell Mobile

My source code: VideoCapture vreader(0); vreader.set(CV_CAP_PROP_FRAME_WIDTH,960); vreader.set(CV_CAP_PROP_FRAME_HEIGHT,1280);

    cv::namedWindow("xyz", 0);

    cv::setWindowProperty("xyz", CV_WND_PROP_FULLSCREEN, CV_WINDOW_FULLSCREEN);

    while(0 == 0)
    {
        Mat frame;
        vreader >> frame;         


        cv::imshow( "xyz", frame );
    }
abhi0329 gravatar imageabhi0329 ( 2017-12-21 10:42:33 -0600 )edit