{"action":"opened","issue":{"url":"https://api.github.com/repos/mshabunin/test2/issues/586","labels_url":"https://api.github.com/repos/mshabunin/test2/issues/586/labels{/name}","comments_url":"https://api.github.com/repos/mshabunin/test2/issues/586/comments","events_url":"https://api.github.com/repos/mshabunin/test2/issues/586/events","html_url":"https://github.com/mshabunin/test2/issues/586","id":95458082,"number":586,"title":"Highgui window is not scaled properly when displaying small images","user":{"login":"mshabunin","id":3304494,"avatar_url":"https://avatars.githubusercontent.com/u/3304494?v=3","gravatar_id":"","url":"https://api.github.com/users/mshabunin","html_url":"https://github.com/mshabunin","followers_url":"https://api.github.com/users/mshabunin/followers","following_url":"https://api.github.com/users/mshabunin/following{/other_user}","gists_url":"https://api.github.com/users/mshabunin/gists{/gist_id}","starred_url":"https://api.github.com/users/mshabunin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mshabunin/subscriptions","organizations_url":"https://api.github.com/users/mshabunin/orgs","repos_url":"https://api.github.com/users/mshabunin/repos","events_url":"https://api.github.com/users/mshabunin/events{/privacy}","received_events_url":"https://api.github.com/users/mshabunin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-16T15:21:27Z","updated_at":"2015-07-16T15:21:27Z","closed_at":null,"body":"Transferred from http://code.opencv.org/issues/3906\r\n```\n|| Khue Le on 2014-09-14 15:48\n|| Priority: Normal\n|| Affected: branch 'master' (3.0-dev)\n|| Category: highgui-gui\n|| Tracker: Bug\n|| Difficulty: \n|| PR: \n|| Platform: x64 / Linux\n```\n\nHighgui window is not scaled properly when displaying small images\n-----------\n```\nIn OpenCV 3.0 (I did not try other versions), when displaying small images, even with the `WINDOW_AUTOSIZE` flag, the window is not scaled properly.\r\n\r\n<pre>\r\n    #include <opencv2/core.hpp>\r\n    #include <opencv2/imgcodecs.hpp>\r\n    #include <opencv2/highgui.hpp>\r\n    #include <iostream>\r\n    \r\n    using namespace cv;\r\n    using namespace std;\r\n    \r\n    int main( int argc, char** argv )\r\n    {\r\n        if( argc != 2)\r\n        {\r\n         cout <<\" Usage: display_image ImageToLoadAndDisplay\" << endl;\r\n         return -1;\r\n        }\r\n    \r\n        Mat image;\r\n        image = imread(argv[1], IMREAD_COLOR); // Read the file\r\n    \r\n        if( image.empty() )                      // Check for invalid input\r\n        {\r\n            cout <<  \"Could not open or find the image\" << std::endl ;\r\n            return -1;\r\n        }\r\n    \r\n        namedWindow( \"Display window\", WINDOW_AUTOSIZE ); // Create a window for display.\r\n        imshow( \"Display window\", image );                // Show our image inside it.\r\n    \r\n        while (waitKey(0) != 27); // Wait for ESC key\r\n        return 0;\r\n    }\r\n\r\n</pre>\r\n\r\nTest image (100x100):\r\n\r\n!http://i.stack.imgur.com/6XB1v.png!\r\n\r\nResults:\r\n\r\n!http://i.stack.imgur.com/LZOU7.png!\r\n\r\nWhen moving the mouse to the displayed image, I got this:\r\n\r\n!http://i.stack.imgur.com/Fo9kx.png!\n```\n\nHistory\n-------\n##### Dmitry Retinskiy on 2014-09-16 07:05\n```\n-   Description changed from In OpenCV 3.0 (I did not try other\n    versions), when displaying small images, e... to In OpenCV 3.0 (I\n    did not try other versions), when displaying small images, e... More\n```\n##### Dmitry Retinskiy on 2014-09-16 07:12\n```\nAlexander, please check the problem.\r\nThanks.\n-   Target version set to 3.0\n-   Assignee set to Alexander Smorkalov\n-   Status changed from New to Open\n-   Category set to highgui-gui\n```\n##### Theodore Tsesmelis on 2015-03-08 18:01\n```\nI can confirm the above bug. I noticed that it is related to the integration with the Qt library. If I compile opencv v.3.0.0 (master branch from github) with Qt4 I do not get this bug, on the other hand if I compile it with Qt5 then it appears. Moreover, on the command line when I am running a project which has to imshow an image I get the following message: *QSettings::value: Empty key passed* twice\n```\n##### Steven Puttemans on 2015-03-09 08:25\n```\nTheodore Tsesmelis wrote:\r\n> I can confirm the above bug. Moreover, I noticed that it is related to the integration with the Qt library. If I compile opencv v.3.0.0 (master branch from github) with Qt4 I do not get this bug, on the other hand if I compile it with Qt5 then it appears. Moreover, on the command line when I am running a project which has to imshow an image I get the following message: *QSettings::value: Empty key passed* twice\r\n\r\nI can concur that this indeed only happens with Qt5 installations. Got same problem here. My solution was to ignore Qt supported builds for the moment, not really need that extra functionality.\n```"}}