Picture always gets resized to maximum. imshow not working as expected
Ok this is a weired one. I have a picture that I show. The picture is very big but normaly it should be able to scale the window. However as soon as I click on the picture it always goes to its huge scale on my machine. What could be the reason?
I insalled OpencCV 4.2.0 with CUDA on KDE NEON 5.18
The toy code for the display to check the issue:
#include <iostream>
#include <thread>
#include <vector>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
int main()
{
std::string _windowName = "Test";
cv::namedWindow(_windowName, cv::WINDOW_NORMAL);
cv::Mat background = cv::imread("../data/nyc.jpg");
while (true)
{
std::this_thread::sleep_for(std::chrono::milliseconds(1));
cv::imshow(_windowName, background);
if (cv::waitKey(33) == 27)
{
cv::destroyAllWindows();
break;
}
}
}
If I run this on my machine it looks like this:
Trying to resize ends up making the picture directly like this:
However on annother machines it poops up scaled and can get resized as expected:
If you want to investigate it. I uploaded the test project on github: You can find it complete in my github here: https://github.com/sandro4912/opencvD...
EDIT: for troubleshooting I also tryed out a python version which does the same:
import cv2
img = cv2.imread("path")
cv2.namedWindow("Window", cv2.WINDOW_NORMAL)
cv2.imshow("Window", img)
if (cv2.waitKey(0) & 0xff) == 27:
cv2.destroyAllWindows()
Still same result as in the C++ version.
I also uninstalled the library and tryed it with OpenCV4.1 and still same result.
What else could I check?