c++ - resizeWindow not working for opencv 2.4.8 in osx 10.9 -
I am using a simple C ++ program in Mac OSX 10.9 using opencv 2.4.8, which QT has been compiled with support and OpenGL. Support. Here's a relevant piece of my semi-config configurations to create OpenCV 2.4.8:
GUI: - QT 4.x: Yes (see version 4.8.6 = OpenSource) - QT OpenGL Support: Yes (/usr/local/Cellar/qt/4.8.5/lib/QtOpenGL.framework) - OpenGL support: Yes (/ system / library / framework / AGL.framework / system / library / framework / opengL.framework) Here is a simple GUI program,
int main (int argc, char * argv []) {nameWindow ("my-win", " WI NDOW_OPENGL "); Int desired WindowWidth = 800, desired WindowHeight = 600; Change shape ("Mary-Win", desired wind-wide, desired Wandowight); CV :: Video Capture Capture (0); For (;;) see Mat; If (capture.ispd ()) {capture & gt; & Gt; opinion; } Imshow (see "my-win"); Four key = (four) waiting (30); If (key == 's') {unsigned char * pixels = new unsigned char [3 * desired WindowWidth * desired WindowHeight]; Glaxics Story (GL_UNPAP_IMENTMENT, 1); GlReadPixels (0, 0, desired WindowWidth, desired WindowHeight, GL_RGB, GL_UNSIGNED_BYTE, pixels); Mat save image (desired window height, desired Wandov wide, CV_8 UC3, pixels); CV :: flip (saved image, saved image, 0); Write (". / Foo.jpg", saved image); }}} Result: I get the window with the current video camera image as output so far everything is fine. But the window I get is small, which I asked for (800 x 600) probably 400 x 300 window. In addition, if I give any proportional window size parameters (example: 1200 x 900), I still get a window of the same size. "Resize window" is not working properly.
There is no way to check the size of the created window. I used to save the window in the form of an image, I get a black 800x600 image with a window content that appears in a corner as 400x300 part.
"itemprop =" text "> excludes
, I was actually using Open 2.1 as the following by producing glxinfo Have demonstrated that. | Grap OpenOpen Vendor String: Intel Ink Open Renderer String: Intel Eyewear Pro OpenGL Engine Open Version String: 2.1 Intel-8.20.26 Open Shading Language Version String: 1.20 Open Extension: I Glew And by including gflw3, my application was rewritten and forced to open version 3.2 of OpenGL. Now I am able to control the window's size.
int main (int argc, char ** argv) {GLFWwindow * window; Const Glubet * strGLVersion; If (! GlfwInit ()) exit (EXIT_FAILURE); // Ask for OpenGL 3.2 glfwWindowHint (GLFW_CONTEXT_VERSION_MAJOR, 3); Gloufwondoihint (GLFW_CONTEXT_VERSION_MINOR, 2); Gluff Windhoint (GLFWOPOngL FORWARD_COMPAT, GLTRUU); Gluff Windhoint (GLFWOPOngLGROLEE, GLFWOPONLPNGLNLONROEROEELEL); Window = Gflavevondo (800, 600, "check-openglal", null, faucet); If (window!) {GlfwTerminate (); Exhaust (EXIT_FAILURE); } GlfwMakeContextCurrent (window); // more affable glewExperimental = true; If (glewInit ()! = GLEW_OK) {glfwTerminate (); Exhaust (EXIT_FAILURE); } // v-sync off glfwSwapInterval (0); // print version strGLVersion = glGetString (GL_VERSION); Cout & lt; & Lt; "GL_VERSION:" & lt; & Lt; StrGLVersion & lt; & Lt; Endl; Constant GLubyte * strGLShadingLanguageVersion = glGetString (GL_SHADING_LANGUAGE_VERSION); Cout & lt; & Lt; "GL_VERSION:" & lt; & Lt; StrGLShadingLanguageVersion & lt; & Lt; Endl; Video capture cap (0); If (! Cap.isOpened ()) // Check whether we have succeeded 1-Return1; Mat image; Caps & gt; & Gt; Image; Const string win_name ("kgeorge-ar"); While (! GlfwWindowShouldClose (window)) {Cap> & Gt; Image; // ----------- 8 & lt; ------ ------- 8th & lt; cutting; ------------ // To change the image the code is open texture // It is omitted to a quad it is omitted // ----------- 8 & LT; ------ ------- Cutting 8 & lt; ------- ----- Gloves swift buffers (window); GlfwPollEvents (); } GlfwTerminate (); Exits (EXIT_SUCCESS); Return 0; }
Comments
Post a Comment