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.
In Linux, try this
#include
int main()
{
char *command="xrandr | grep '*'";
FILE *fpipe = (FILE*)popen(command,"r");
char line[256];
while ( fgets( line, sizeof(line), fpipe))
{
printf("%s", line);
}
pclose(fpipe);
return 0;
}
In Windows,
http://cppkid.wordpress.com/2009/01/07/how-to-get-the-screen-resolution-in-pixels/