Kinect / PyKinect2

Wrapper to expose Kinect for Windows v2 API in Python
MIT License
496 stars 236 forks source link

Outputting no frames or data to screen. [URGENT] #85

Open RoboFinley opened 3 years ago

RoboFinley commented 3 years ago

I am trying to run the examples given. When I run PyKinectBodyGame I get no errors and the lights on the Kinect (Xbox One version) turn on but it doesn't detect any frames or output anything to the pygame window. I also get an error while running the PyKinectInfraRed example, an error stating AttributeError: 'PyKinectRuntime' object has no attribute 'infrared_frame_desc'.

I did have to make a change to line 2216 in the PyKinectV2, changing thesizeof(tagSTATSTG) == 72 to a <=, I also changed line 154 in PyKinectRuntime, changing the .clock() to a .process_time() because clock() is no longer supported as it was returning an error. The Kinect does work as it does show output using Kinect Studio. Am I missing something? I am using the pycharm IDE and have downloaded pykinect2 through the python interpreter settings section, I have also tried downloading directly from github using the easy_install and the version still seems to be 0.1.0. This not only doesnt fix anything, it also means I cant make changes to the PyKinectRuntime file to solve the clock() error anymore as it is saying it has failed to make it writable.

If I have not given some information needed to answer my question please let me know and I will add it in.

Thank you in advance for your help.

ukasu commented 3 years ago

I have same problem. There no frames or data in pygame window. I'm getting the self._kinect.has_new_color_frame() as a False value in 136. line of example file . Why?

WangXingfang commented 3 years ago

I have the same problem. Do you have a solution?

ukasu commented 3 years ago

I checked in has_new_color_frame function in PyKinectRuntime.py When I run the example I seen that self._last_color_frame_time and self._last_color_frame_access value are the same. In IF-ELSE block it has to be self._last_color_frame_time bigger than self._last_color_frame_access. Otherwise the block return false and there is no data or screen in program

ukasu commented 3 years ago

I solved the problem. The solution is that replace all time.clock() to time.perf_counter() in PyKinectRuntime.py

2021-01-07 16_00_43-E__PythonExample_kinect py

WangXingfang commented 3 years ago

I solved the problem. The solution is that replace all time.clock() to time.perf_counter() in PyKinectRuntime.py

2021-01-07 16_00_43-E__PythonExample_kinect py

Got it! Thank you very much.

mamoonik commented 2 years ago

need help with this issue!!