Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kinect restart over and over while trying to acces point cloud of the body. #3

Open
Raphaelb10 opened this issue Apr 14, 2021 · 4 comments

Comments

@Raphaelb10
Copy link

Hi,
First, thanks a lot for this usefull code.
The feature I need the most is to extract a pointcloud of the body and save it. Unfortunately, this is the only one that does not work more than 5sec. Everything is starting, I can play with the taskbars, and then if I try to show the point cloud of the body, it last a few seconds, then the windows turns black and the kinect start to reboot over and over.

I joined a video so you can check it yourself. I don't know if you have any idea on how to solve this ? Or any advice on how to save on a file the body of an user ? The lack of documentation on the pykinect2 library is making this task really hard for me.
Thank you in advance.

video-1618327101.mp4
@KonstantinosAng
Copy link
Owner

Hi, i can see the video, and it seems very strange. Are you using a Kinect for Windows 2 or a Kinect for Xbox 360?. As I coded this project a while ago I am not able to help you. What do you mean save the body in a file ? If you watch in my PointCloud.py file i calculate the body index data in the update function in line 420 for the depth frame only. In the next lines I filter bad data points. From line 426 to 428 I compute all the world points and the use the body index data from the depth frame to isolate only the world body index data. Then in line 437 I just add the body points to the global array self._dynamic_point_cloud that i use to plot all the points. Maybe you can store that global array in a file using json.dumps() and then load it with json.loads when you need it. As for documentation on pykinect2 library, I have documentation on the mapper function in here:

https://github.com/KonstantinosAng/PyKinect2-Mapper-Functions

You can also find many examples on how to get the color, depth, body or body index image from here:

Kinect/PyKinect2#79
https://github.com/Kinect/PyKinect2/tree/master/examples

and you can also check the file track_v3.py file in my repository, it has all the functionality for the kinect but it is very big and you can get lost easily.

@KonstantinosAng
Copy link
Owner

As for the restarting of the Kinect, try to reinstall the KinectStudio and also use a different usb port to see if it the kinect still restarts.

@Raphaelb10
Copy link
Author

Hi, thanks for answering so fast !

I've a kinect for windows, and I've tried to reinstal the whole SDK and switch USB port. I can use the kinect studio works fine and all the other features of your code as well.

Thanks also for the explanations you made for your code. What i'm trying to do is to record some sequence of a human working alongside a Robot, delete everything that is not the human body, then save this as a point cloud ( of each frame I guess), to reload it in a virtual environment where my supervisor will "train" the collaborative robot., according to what the worker is doing.

So yeah I think that my best option, since I cannot fix this, is to try to do the same procedure as you did and then save it as text file, while adding a fourth dimension to number the frames.
I'm struggling a lot with this pykinect2 tbh, so thanks a lot for these examples and informations !
Have a good day !

@KonstantinosAng
Copy link
Owner

Glad to here it, i have done similar work in this repository but without pointclouds. If you want to check it out. Good luck and feel free to ask me anything in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants