Opengl problem zed 2 camera

Hello Everyone

I have installed all the requirements and i have run a couple of demos but when i try to run object_detection_image_viewer.py it gives me this error

OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling

I am currently running it on windows 10
Cuda 10.2
and an RTX 5000
if that information helps

I’m running it on my base environment and i have all the packages installed i have been able to use the Zed explorer and so on. but not to run the python script , object detection
im using python 3.6.8 and this is the packages that i have installed

image

this is the full error

Traceback (most recent call last):
File “C:/Program Files (x86)/ZED SDK/samples/object detection/birds eye viewer/python/object_detection_birds_view.py”, line 71, in
viewer.init(camera_model, res)
File “C:\Program Files (x86)\ZED SDK\samples\object detection\birds eye viewer\python\ogl_viewer\viewer.py”, line 412, in init
glutInit(sys.argv)
File “C:\Users\EmTech\AppData\Local\Programs\Python\Python36\lib\site-packages\OpenGL\GLUT\special.py”, line 333, in glutInit
_base_glutInit( ctypes.byref(count), holder )
File “C:\Users\EmTech\AppData\Local\Programs\Python\Python36\lib\site-packages\OpenGL\platform\baseplatform.py”, line 425, in call
self.name, self.name,
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling

Hi @dlraro,

Sorry for the late reply.
As you already seem to have the required PyOpenGL packages, can you try following the suggestion on that page and see if it helps with your issue ?
The suggested workaround is to download this package and place freeglut.dll in the folder of the python script you are trying to run

Hello.
I’m having a similar issue while trying to run Spatial Mapping example.

Traceback (most recent call last):
File “D:/SkyOcean/UMS/SW/ZED2/zed_test.py”, line 299, in
spatial_mapping()
File “D:/SkyOcean/UMS/SW/ZED2/zed_test.py”, line 196, in spatial_mapping
viewer.init(camera_params, pymesh)
File “D:\SkyOcean\UMS\SW\ZED2\ogl_viewer\viewer.py”, line 211, in init
glutInit()
File “D:\SkyOcean\UMS\SW\ZED2\venv\lib\site-packages\OpenGL\GLUT\special.py”, line 333, in glutInit
_base_glutInit( ctypes.byref(count), holder )
File “D:\SkyOcean\UMS\SW\ZED2\venv\lib\site-packages\OpenGL\platform\baseplatform.py”, line 425, in call
self.name, self.name,
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling

I’ve been searching for a fix and followed your instruction.

  • downloaded ‘glut.dll’, ‘glut32.dll’, and ‘freeglut.dll’
  • copied them into the folder of my python working folder.
  • I also copied them into the windows system folders ( SysWOW64 and System32 )
    The problem still exist.
    Any idea why it’s not fixed?
    I have followed tutorials from HelloZED to Positional Tracking and had no issues.

Just fixed it by reinstalling ‘pyopengl’ and ‘pyopengl-accelerate’.
Thank you.

The main reason is that your windows are 64-bit, but after installing using the command pip install pyopengl, the execution example uses pyopengl_32 bit by default, so the above error occurs!

Uninstall first then reinstall PyOpenGl and PyOpenGL-accelerate manually.
Download wheel files here: Python Extension Packages for Windows - Christoph Gohlke
Select the correct file by checking file name with your system version (should be 64bits) and your python verison (choose cp37 if your python version is 3.7)