How do I get the computer screen resolution on OpenCV? I need to show two images side by side using the whole screen width, OpenCV requires the exact window size I wanna create.
This is not an answer to how to get the screen width and height, but it will let you solve your problem of displaying two images using the full screen size.
1) Create a window like this:
namedWindow("hello", WINDOW_NORMAL);
This will allow you to set the window size yourself, you can set easily maximize it and it will take the whole screen. It will also remember the settings the next time you run the program. You can also set flags to keep the aspect ratio if you desire.
2) If you need to get the exact number of pixels, you can get the window size using this:
getWindowImageRect("hello");
That way, you can easily combine the two images into one and display the result on screen. I'm doing it myself.