MasteringOpenCV / code

Code for the book "Mastering OpenCV with Practical Computer Vision Projects" by Packt Publishing 2012.
Other
2.73k stars 1.65k forks source link

OpenCV issue : No OpenGL support(Library built without OpenGL support) in cvNamedWIndows ,file .\ \\opencv\modules\highgui\src\window_w32.cpp line 746 #25

Closed Reena24 closed 10 years ago

Reena24 commented 10 years ago

I am trying the code for Markerless AR in Visual Studio 2008 with OpenCV 2.4.4 in Windows 7but i come across this error. I have configured everything needed for the code. I downloaded Opencv 2.4.4.exe from sourceforge and enabled OpenGL using cmake but it still shows error. It shows the same error for the function: cv::namedWindow(windowName, cv::WINDOW_OPENGL); cv::setOpenGlContext(windowName); cv::setOpenGlDrawCallback(windowName, ARDrawingContextDrawCallback, this); I use the Intel graphics(Generic PnP Monitor on Intel HD Graphics 4000 Driver version 10.18.10.3345) I also tried the same code in Nvidia system which showed the same error. I would really like it if i could a stepwise instruction on how to setup the markerless ar project and solve the OpenGL support problem. I fell its a code error I have a deadline of 2 days to complete the code I could use all the help i can get . Please Help!!! 1

shervinemami commented 10 years ago

That error message is displayed by OpenCV, so OpenCV is telling you it wasn't compiled with OpenGL support. If you enabled it in CMake when building OpenCV library yourself, then it means it didn't find the correct OpenGL development library so it ignored your Cmake setting and built OpenCV without OpenGL. (It would have shown you a warning message in CMake but it is not obvious if it shows so many messages). So you need to make sure you have installed OpenGL SDK or something like that, for your OS, then use CMake to build OpenCV library from scratch again, and make sure it really does use OpenGL support.

BloodAxe commented 10 years ago

On Windows platform you don't need to install any SDK. VIsual Studio has everything it needs to build OpenCV with OpenGL. You can check OpenGL support and build configuration by calling cv::getBuildInformation(). As @shervinemami told, it's likely that you are using wrong OpenCV libraries. So i would suggest that you double-check OpenCV libraries (Maybe you have old OpenCV build somewhere on your system that is used instead of new one?).

Reena24 commented 10 years ago

So where should i download the proper OpenCV libraries from to solve the problem cause I have tried different OpenCV versions but it does not work . I would like to know the proper path from where I should download for Visual Studio 2008

arthur1026 commented 10 years ago

On windows, I think you should download the OpenCV source and CMake to re-build the OpenCV library with ENABLE_OPENGL=ON flag. The pre-compiled version you have downloaded usually does not support OpenGL. I believe Chapter 3 has the instructions on how to build OpenCV with OpenGL support.

Reena24 commented 10 years ago

Is there a particular version of OpenCV that i should download and install or is any version fine

arthur1026 commented 10 years ago

Any version is fine :)

Reena24 commented 10 years ago

Hi I reconfigure Opencv 2.4.4. I followed the instruction as told in http://docs.opencv.org/2.4.4/doc/tutorials/introduction/windows_install/windows_install.html#installation-by-making-your-own-libraries-from-the-source-files 1

I was successfully able to execute the contours program. I was able to check if I have the opengl support library But I am not able to include the same Opengl library in another project. I am not sure how to set the opengl library for another project using Cmake. I end up having the same error. I tried to configure using cmake but am not sure of the path. I have set the environment variable as OpenCV_DIR : E:\opencv\build\x86\vc9 Path : E:\opencv\build\x86\vc9;E:\opencv\dep\tbb42_20131118oss\bin\ia32\vc9 QTDIR : E:\opencv\dep\qt\qt-everywhere-opensource-src-4.8.5;E:\opencv\dep\qt\qt-everywhere-opensource-src-4.8.5\bin

I have installed opencv in E:\opencv . Can I get a stepwise instruction on how to configure opengl for the markerless ar demo 2

When i configured the same path I get an error . Please tell me what to do ?? How to set the opengl library

Reena24 commented 10 years ago

Thankyou i configured Opencv properly am now using in the code

Reena24 commented 10 years ago

Thank a lot my code for Markerless AR has finally started to work

chenxinhua commented 8 years ago

how to solve the problem no opengl support(library was built without opengl support)

BloodAxe commented 8 years ago

Unfortunately, OpenGL support is not supported on MAC. As far as I know, OpenCV dev. team does not have plans to implement OpenGL support for this platform.

2016-06-30 11:03 GMT+03:00 chenxinhua notifications@github.com:

how to solve the problem no opengl support(library was built without opengl support)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MasteringOpenCV/code/issues/25#issuecomment-229589997, or mute the thread https://github.com/notifications/unsubscribe/AAgfYLLvrYtvjorBnmlTstPkiFJhtVKwks5qQ3g6gaJpZM4BflL- .

coryl commented 8 years ago

How to build with MAC and QT5: http://programmingopencvopengletc.blogspot.ca/2014/11/opengl-support-for-opencv-249-in-mac-os.html

gohyz commented 7 years ago

I also met this problem. Finally I found that it is because I added another opencv to the Path environment. how can you know this. if you use MSVC, you can check the Output TAB of the MSVC IDE. in the Output TAB you can see the loading module as show in the below. Hope this can help the guys who met the same problem.

/////////////////////////////////////// 'markerless_ar_demo.exe' (Win32): Loaded 'E:\00_SfM\Mastering_OpenCV_Code\Chapter3_MarkerlessAR\build\src\Debug\markerless_ar_demo.exe'. Symbols loaded. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or open the PDB file. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\opengl32.dll'. Cannot find or open the PDB file. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Cannot find or open the PDB file. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Cannot find or open the PDB file. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Cannot find or open the PDB file. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Cannot find or open the PDB file. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. Cannot find or open the PDB file. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'. Cannot find or open the PDB file. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. Cannot find or open the PDB file. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'. Cannot find or open the PDB file. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\ddraw.dll'. Cannot find or open the PDB file. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\dciman32.dll'. Cannot find or open the PDB file. 'markerless_ar_demo.exe' (Win32): Loaded 'E:\00_SfM\Mastering_OpenCV_Code\Chapter3_MarkerlessAR\build\src\Debug\opencv_calib3d2413d.dll'. Symbols loaded. 'markerless_ar_demo.exe' (Win32): Loaded 'E:\00_SfM\Mastering_OpenCV_Code\Chapter3_MarkerlessAR\build\src\Debug\opencv_highgui2413d.dll'. Symbols loaded. 'markerless_ar_demo.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. Cannot find or open the PDB file.