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

distortion and tilt #90

Open
jmatthess opened this issue Jun 7, 2021 · 5 comments
Open

distortion and tilt #90

jmatthess opened this issue Jun 7, 2021 · 5 comments

Comments

@jmatthess
Copy link

Hi

Has anyone been able to determine if the library corrects for distortion as well as tilt? i'm trying to get the kinect skeleton into a 3D program and i cant tell if the lib corrects for lens distortion. I dont think it does for tilt but im not 100% sure.
If it does, has anyone been able to correctly undistort the 3d coordinate values of the joints?

im getting the skeleton position in this way and from what ive been able to see and from other issue posts, this is indeed outputting in meters.

floorClipPlane = _bodies.floor_clip_plane
floorW = floorClipPlane.w

joints = body.joints
skeleton = _kinect.body_joints_to_color_space(joints)
x = joints[PyKinectV2.JointType_SpineShoulder].Position.x
y = joints[PyKinectV2.JointType_SpineShoulder].Position.y + floorW
z = joints[PyKinectV2.JointType_SpineShoulder].Position.z

@KonstantinosAng
Copy link

I think it corrects for lens distortion, but the tilt of Kinect position is not cosnidered a distortion. You can calculate the Kinect's tilt and Position from the floor using this code:

floor_vector = self._bodies.floor_clip_plane
kinect_distance_from_plane = floor_vector.w * 1000 # mm
kinect_tilt = np.arctan(floor_vector.z / floor_vector.y) * (180.0 / np.pi) # degrees

Make sure that the kinect is tracking someone first!!!!!

@jmatthess
Copy link
Author

Thanks for the quick reply @KonstantinosAng learnt alot from reading your mapper library.
I dont suppose you would know how to apply the tilt angle to correct for the position data would you? ive tried looking at alot of resources but nit been able to find a methodology on how to correct for the tilt.

@KonstantinosAng
Copy link

I always had the Kinect at a tilt anlgle but it did not produce any wrong data. Why do you think the position data need to be corrected ? Also keep in mind that the Kinect tracking algorithm works better between the range 0.5 to 4 meters.

@jmatthess
Copy link
Author

jmatthess commented Jun 7, 2021

So im sending the xyz position data directly into a 3d program. i'm standing about 2 meters away from the kinect in a well lit room with no sun coming through the window to throw things off. and just by doing a TPose. From the foot to the head the Z position gets pushed back a little bit more as you go up each joint. but also by tilting the camera i got slightly different height results.
i know that the kinect does have some margin for error for but the top of the skeleton appears to get pushed down a little with the camera tilted down a bit more. But if you're not experiencing the same, i may have to do a bit further testing as to what may be going on as the only other info im having to go off of are peoples post online and several people have mentioned compensating for tilt . this is one example, i cant find the original
one that sent me down the assumption that tilt isnt compensated but this is one of many posts thats leading me to assume this https://stackoverflow.com/questions/57057802/kinect-v2-how-to-transform-kinect-v2-coordinate-to-real-life-measurements

@KonstantinosAng
Copy link

Use this repo i created and see if you get distorted data in 3D. I had no problem when i created it and it could track me very accurately inside the room.

https://github.com/KonstantinosAng/PyKinect2-PyQtGraph-PointClouds

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