I am using zed2i with segment anything model which is working fine . now i want to do 3d reconstruction of of object using image captured, after doing all the steps involved in downloading all the dependencies i am not able to import ogl_viewer.viewer as gl.
pip install PyOpenGl PyOpenGl_accelerate
Requirement already satisfied: PyOpenGl in c:\users\iac\anaconda3\envs\zed_env\lib\site-packages (3.1.1a1)
Requirement already satisfied: PyOpenGl_accelerate in c:\users\iac\anaconda3\envs\zed_env\lib\site-packages (3.1.6)
Note: you may need to restart the kernel to use updated packages.
import sys
import time
import pyzed.sl as sl
import pygame as pg
import ogl_viewer.viewer as gl
Traceback (most recent call last):
Cell In[7], line 6
import ogl_viewer.viewer as gl
ModuleNotFoundError: No module named âogl_viewerâ
import sys
import time
import pyzed.sl as sl
import ogl_viewer.viewer as gl
Traceback (most recent call last):
Cell In[8], line 4
import ogl_viewer.viewer as gl
ModuleNotFoundError: No module named âogl_viewerâ
i am currently running this on spyder anaconda platform, and i have created a virtual environment . How do i fix this issue
1 Like
Hi,
If you took the example of our samples, there is a ogl_viewer folder alongside them. You need this folder alongside your program so that it can import it right.
Hey @alassagne thank you for the quick response. I did what you had instructed me but i am facing a new issue with open gl
runfile(âC:/Program Files (x86)/ZED SDK/samples/spatial mapping/spatial mapping/python/ogl_viewer/viewer.pyâ, wdir=âC:/Program Files (x86)/ZED SDK/samples/spatial mapping/spatial mapping/python/ogl_viewerâ)
Reloaded modules: ogl_viewer.viewer
runfile(âC:/Program Files (x86)/ZED SDK/samples/spatial mapping/spatial mapping/python/spatial_mapping.pyâ, wdir=âC:/Program Files (x86)/ZED SDK/samples/spatial mapping/spatial mapping/pythonâ)
Running Spatial Mapping sample ⌠Press âqâ to quit
Traceback (most recent call last):
File ~\anaconda3\envs\ZED_Env\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)
File c:\program files (x86)\zed sdk\samples\spatial mapping\spatial mapping\python\spatial_mapping.py:174
main()
File c:\program files (x86)\zed sdk\samples\spatial mapping\spatial mapping\python\spatial_mapping.py:72 in main
viewer.init(camera_parameters, pymesh, CREATE_MESH)
File C:\Program Files (x86)\ZED SDK\samples\spatial mapping\spatial mapping\python\ogl_viewer\viewer.py:236 in init
glutCreateWindow(âZED Spatial Mappingâ)
File ~\anaconda3\envs\ZED_Env\lib\site-packages\OpenGL\GLUT\special.py:73 in glutCreateWindow
return __glutCreateWindowWithExit(title, _exitfunc)
ArgumentError: argument 1: TypeError: wrong type
can you please let me know how do i solve this.
Thanks im advance
Hi,
Itâs because you took an opengl viewer that was in some other code but does not work with yours. You need to adapt it a bit.
its from the same code given by zed samples
What does happen when you run the original sample ?
If you have an issue, it can also be a mismatch between your SDK version and sample version. You can ensure you have the right one by using the sample that are provided in the SDK installation folder.
The program simply does not run and mapping