在NITE2 python绑定中创建UserTracker会崩溃 [英] Creating a UserTracker crashes in NITE2 python bindings

查看:230
本文介绍了在NITE2 python绑定中创建UserTracker会崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用OpenNI2和NITE2 python绑定.我在Windows 7下,并且我的Kinect SDK1.8,OpenNI 2.2和NITE 2.2在32位版本的Visual C ++中都可以正常工作.我有python 2.7.5 32位.

I am trying to use OpenNI2 and NITE2 python bindings. I'm under Windows 7 and I have Kinect SDK1.8, OpenNI 2.2 and NITE 2.2 working without problems in Visual C++ with their 32 bits versions. I have python 2.7.5 32 bits.

现在,我的意图是将NITE中提供的一些示例转换为python,但是我仍然没有找到如何在不使程序崩溃的情况下创建UserTracker的方法(HandTracker也是如此).我已经能够运行提供的玩具示例(它不会利用NITE).这就是我正在做的事情,但我得到的错误-我发现信息不多-:

Now, my intention is to translate some of the examples provided in NITE to python, but I still haven't found how to create a UserTracker without the program crashing (the same goes for HandTracker). I have been able to run the toy example provided (which doesn't make use of NITE). This is what I'm doing and the error I get -which I don't find very informative-:

In [1]: from primesense import openni2, nite2

In [2]: nite2.initialize()

In [3]: dev = openni2.Device.open_any()

In [4]: ut = nite2.UserTracker(dev)
---------------------------------------------------------------------------
NiteError                                 Traceback (most recent call last)
<ipython-input-4-5be0b82b0a2b> in <module>()
----> 1 ut = nite2.UserTracker(dev)

C:\Python27\lib\site-packages\primesense-2.2.0.30_5-py2.7.egg\primesense\nite2.p
yc in __init__(self, device)
    198             self._devstruct = _NiteDevStruct()
    199             self._devstruct.device = device._handle
--> 200             c_api.niteInitializeUserTrackerByDevice(ctypes.byref(self._d
evstruct), ctypes.byref(handle))
    201         HandleObject.__init__(self, handle)
    202         _registered_user_trackers.add(self)

C:\Python27\lib\site-packages\primesense-2.2.0.30_5-py2.7.egg\primesense\_nite2.
pyc in wrapper(*args)
    693         res = func(*args)
    694         if res != NiteStatus.NITE_STATUS_OK:
--> 695             raise NiteError(res)
    696         return res
    697

NiteError: NiteStatus.NITE_STATUS_ERROR

我已经尝试过初始化设备的深度流,然后再将其传递给UserTracker创建者,但仍然无法正常工作.

I have already tried initializing the depth stream of the device before passing it to the UserTracker creator, but still doesn't work.

有人能使NITE2 python绑定起作用吗?如果是这样,我有什么想念的吗?

Has anyone been able to make NITE2 python bindings work? If so, is there something I'm missing?

推荐答案

我终于可以使其工作了,但我确实认为Nite和Primesense python绑定版本有些混乱,因此我以防万一有人遇到同样的问题.

I've finally been able to make it work but I trully think there's a mess with versions regarding Nite and primesense python bindings, so I'll share in case someone goes through the same problems.

当我发布问题时,我正在使用(如所示)从openNI网站和 Nite 2.2 .

When I posted the question I was using (as indicated) the python bindings downloaded from openNI website and Nite 2.2.

我尝试从pyPi下载最新版本,该版本为 2.2.0.30-5 ,然后初始化nite2(nite2.initialize())时出现错误,因为它无法在C API中找到方法niteDumpUserTrackerCalibrationDataToFile.

I tried downloading the latest version from pyPi, which is 2.2.0.30-5 and then I got an error when initializing nite2 (nite2.initialize()) because it wasn't able to find the method niteDumpUserTrackerCalibrationDataToFile in the C API.

解决方案"?我将Nite降级为2.0版,该方法实际上存在.我认为这不是最好的解决方案. Nite的最新版本及其python绑定应该可以协同工作,而无需修改代码或降级.

The "solution"? I downgraded Nite to version 2.0, where that method is actually present. I think this is not the best solution. The latest versions for Nite and its python bindings should work together without having to hack the code or downgrading.

总结:它适用于pyPi和 Nite 2.0.0 python bindinngs 2.2.0.30-5 ,但应该与 Nite 2.2一起使用.

To summarize: it's working for me with python bindinngs 2.2.0.30-5 from pyPi and Nite 2.0.0, but is should work with Nite 2.2.

这篇关于在NITE2 python绑定中创建UserTracker会崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆