moberweger / deep-prior-pp

Improving Fast And Accurate 3D Hand Pose Estimation
GNU General Public License v3.0
144 stars 41 forks source link

Can this code run on Kinect v1? #17

Closed qhykwsw closed 6 years ago

qhykwsw commented 6 years ago

Hi, thank you for your research. I want to run your code on my own computer. My OS is Ubuntu 14.04 and camera is kinect v1. Does your code fit this camera or must be used with Creative Senz3D?

moberweger commented 6 years ago

Essentially it does run with kinect, but you need to do some modifications in the realtime pipeline and add the camera device for kinect.

qianhongyi notifications@github.com schrieb am So., 17. Juni 2018 9:23 nachm.:

Hi, thank you for your research. I want to run your code on my own computer. My OS is Ubuntu 14.04 and camera is kinect v1. Does your code fit this camera or must be used with Creative Senz3D?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/moberweger/deep-prior-pp/issues/17, or mute the thread https://github.com/notifications/unsubscribe-auth/AKEhXCySERqefI1A7wDIOsbYts_Dp2jQks5t9x0jgaJpZM4UrHAU .

qhykwsw commented 6 years ago

Thank you so much for your advice. I read your code and changed "dev = CreativeCameraDevice(mirror=True)" to "dev = DepthSenseCameraDevice(mirror=True)" to use kinect v1. However, I got the error as follows:

NYUImporter_test_1_None_False_gt_300__cache.pkl Create producer process... Create consumer process... Process Process-2: Traceback (most recent call last): File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run self._target(*self._args, **self._kwargs) File "/home/hyqian/projects/deep-prior-pp/src/util/realtimehandposepipeline.py", line 139, in threadProducer device.start() File "/home/hyqian/projects/deep-prior-pp/src/util/cameradevice.py", line 282, in start self.ctx = openni.Context() AttributeError: 'module' object has no attribute 'Context'

I have install OpenNI 1.0 for kinect. Can you give me some advices? I really appreciate it.

moberweger commented 6 years ago

Great to hear. Did you check some examples for openni? Probably the api changed.

qianhongyi notifications@github.com schrieb am So., 24. Juni 2018 2:26 vorm.:

Thank you so much for your advice. I read your code and changed "dev = CreativeCameraDevice(mirror=True)" to "dev = DepthSenseCameraDevice(mirror=True)" to use kinect v1. However, I got the error as follows:

NYUImporter_test_1_None_False_gt_300__cache.pkl Create producer process... Create consumer process... Process Process-2: Traceback (most recent call last): File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run self._target(*self._args, **self._kwargs) File "/home/hyqian/projects/deep-prior-pp/src/util/realtimehandposepipeline.py", line 139, in threadProducer device.start() File "/home/hyqian/projects/deep-prior-pp/src/util/cameradevice.py", line 282, in start self.ctx = openni.Context() AttributeError: 'module' object has no attribute 'Context'

I have install OpenNI 1.0 for kinect. Can you give me some advices? I really appreciate it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/moberweger/deep-prior-pp/issues/17#issuecomment-399738972, or mute the thread https://github.com/notifications/unsubscribe-auth/AKEhXDZa0tUrhx4nlwrbX_Ya5wlyG_Igks5t_00rgaJpZM4UrHAU .

qhykwsw commented 6 years ago

Actually, the OpenNI for Kinect only has C++ API and I could run the examples such as the NiViewer. I installed the python module "openni" by "pip2 install openni --user", and I found the module's version is "2.2.0.post6". I did some google search and found that the module is only for OpenNI2 instead of OpenNI1.

qhykwsw commented 6 years ago

Hi, Because I don't want to reinstall OpenNI to the 2nd version. So I installed the "OpenKinect/libfreenect" for Kinect v1 to use the python API to collect the depth image. Then I did some modifications in the realtime pipeline and add the camera device for kinect and finally I made it. Thanks for your advices and patience.

moberweger commented 6 years ago

That is nice. Great to hear that :)

qianhongyi notifications@github.com schrieb am Mo., 25. Juni 2018 12:47 vorm.:

Hi, Because I don't want to reinstall OpenNI to the 2nd version. So I installed the "OpenKinect/libfreenect" for Kinect v1 to use the python API to collect the depth image. Then I did some modifications in the realtime pipeline and add the camera device for kinect and finally I made it. Thanks for your advices and patience.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/moberweger/deep-prior-pp/issues/17#issuecomment-399849129, or mute the thread https://github.com/notifications/unsubscribe-auth/AKEhXCSht-NztX05QnXmeApf2eyhLFtJks5uAId4gaJpZM4UrHAU .

qhykwsw commented 6 years ago

Sorry to bother you again. I found that if I use the orgin picture from the kinect the result will be bad. The system could't detect my hand and regress the keypoints with a little wave. Do I need do some pretreatments on the orgin picture?

moberweger commented 6 years ago

The hand detection should work with any camera (closest object to camera). Did you set the camera intrinsics in the main file? The other parts are trained from data and thus resemble the sensor noise. For kinect v1, the NYU dataset should have the closest camera specs.

qianhongyi notifications@github.com schrieb am Di., 26. Juni 2018 3:46 vorm.:

Sorry to bother you again. I found that if I use the orgin picture from the kinect the result will be bad. The system could't detect my hand and regress the keypoints with a little wave. Do I need do some pretreatments on the orgin picture?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/moberweger/deep-prior-pp/issues/17#issuecomment-400248458, or mute the thread https://github.com/notifications/unsubscribe-auth/AKEhXNRX5FK9p26hls7hJx2Iby9vdQQvks5uAgL5gaJpZM4UrHAU .

qhykwsw commented 6 years ago

I truly used the NYU dataset. I read your code and found the "getDepthIntrinsics()" function in the file named "cameradevice.py", but I also found that the object "DepthSenseCameraDevice" for kinect doesn't use the camera intrinsics. And I also observed the output of the depth information, it's already a (480, 640) numpy matrix so it seemed that it doesn't need to use the camera intrinsics.

moberweger commented 6 years ago

The intrinsics should be specified in the main file as fx and fy. It is used for the hand detector.

qianhongyi notifications@github.com schrieb am Di., 26. Juni 2018 7:14 vorm.:

I truly used the NYU dataset. I read your code and found the "getDepthIntrinsics()" function in the file named "cameradevice.py", but I also found that the object "DepthSenseCameraDevice" for kinect doesn't use the camera intrinsics. And I also observed the output of the depth information, it's already a (480, 640) numpy matrix so it seemed that it doesn't need to use the camera intrinsics.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/moberweger/deep-prior-pp/issues/17#issuecomment-400303237, or mute the thread https://github.com/notifications/unsubscribe-auth/AKEhXBRFGI_Km3Rd4d4GZjblzb-NOxUDks5uAjPMgaJpZM4UrHAU .

qhykwsw commented 6 years ago

Do you mean the "config = {'fx': 588., 'fy': 587., 'cube': (300, 300, 300)}" in the test_realtimepipeline.py?

moberweger commented 6 years ago

Yes, fx and fy depend on your camera.

qianhongyi notifications@github.com schrieb am Di., 26. Juni 2018 7:10 nachm.:

Do you mean the "config = {'fx': 588., 'fy': 587., 'cube': (300, 300, 300)}" in the test_realtimepipeline.py?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/moberweger/deep-prior-pp/issues/17#issuecomment-400511174, or mute the thread https://github.com/notifications/unsubscribe-auth/AKEhXL-jT6mx9-a5xxJiZv1zcaFcmDg5ks5uAtudgaJpZM4UrHAU .

qhykwsw commented 6 years ago

Oh, I originally thought that all kinect v1 has the same intrinsics. I will do some search to find them, thank you.