我正在尝试在Ubuntu下使用我的kinect上的Python primesense模块。我似乎正确安装了OpenNI2,因为我能够使用处理的simple-openni库运行处理精细的示例。我使用pip安装了primesense模块,先在virtualenv中安装,然后在系统上安装相同的结果。
从iPython,我接收以下内容:
In [1]: from primesense import openni2
In [2]: openni2.initialize()
---------------------------------------------------------------------------
InitializationError Traceback (most recent call last)
<ipython-input-2-4a1f095d5922> in <module>()
----> 1 openni2.initialize()
/usr/local/lib/python2.7/dist-packages/primesense/openni2.pyc in initialize(dll_directories)
95 if not found:
96 raise InitializationError("OpenNI2 could not be loaded:\n %s" %
---> 97 ("\n ".join("%s: %s" % (dir, ex) for dir, ex in exceptions)),)
98
99 _openni2_initialized = True
InitializationError: OpenNI2 could not be loaded:
/home/escher/pyenv/libOpenNI2.so: file does not exist
我尝试从/usr/lib/libOpenNI.so创建符号到/usr/lib/libOpenNI2.so,然后我更改为/ usr / lib /目录。这就是我得到的:
openni2.initialize()
---------------------------------------------------------------------------
InitializationError Traceback (most recent call last)
<ipython-input-5-4a1f095d5922> in <module>()
----> 1 openni2.initialize()
/usr/local/lib/python2.7/dist-packages/primesense/openni2.pyc in initialize(dll_directories)
95 if not found:
96 raise InitializationError("OpenNI2 could not be loaded:\n %s" %
---> 97 ("\n ".join("%s: %s" % (dir, ex) for dir, ex in exceptions)),)
98
99 _openni2_initialized = True
InitializationError: OpenNI2 could not be loaded:
/usr/lib/libOpenNI2.so: /usr/lib/libOpenNI2.so: undefined symbol: oniInitialize
我做错了什么,或者包装是否破损,无论哪种情况,我能做些什么才能让工作变得有效?
答案 0 :(得分:2)
问题是两件事的结合:
在openni2.initialize()上,我应该将路径传递给Redist目录,它默认为primesense模块中的当前目录。
我没有为我的发行版下载正确的实现(虽然它似乎可以正常处理)。我已经下载,构建并安装了OpenNI.master.zip,我应该下载OpenNI-Linux-x64-2.2.0.33.tar.zip。