Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have successfully implemented the floor clip plane to measure the distance of left foot to the floor, which is fairly accurate. The problem I have is that as I move away from the camera (i.e. left foot Z axis is increased), the foot distance to the floor changes (increases).
Note: The floor itself is not tilted nor the Kinect stand.
I tested it with Kinect 1 and had the same result. The subject's head height (Y axis) also changes value as I move away or get closer to the camera. It does not matter of the camera is tilted or line of sight. the D value in the FloorClipPlane equation shows a constant number during the test.

C#
A = bodyFrame.FloorClipPlane.X;
B = bodyFrame.FloorClipPlane.Y;
C = bodyFrame.FloorClipPlane.Z;
D = bodyFrame.FloorClipPlane.W;


distanceLeftFoot = A * leftFootPosX + B * leftFootPosY + C * leftFootPosZ + D;


double divisor = Math.Sqrt(leftFootPosX * leftFootPosX + leftFootPosY * leftFootPosY + leftFootPosZ * leftFootPosZ); 


float temp=Convert.ToSingle(divisor);


distanceLeftFoot = (A * leftFootPosX + B * leftFootPosY + C * leftFootPosZ + D)/ temp;


Just to let you know, I have coordinate mapping between depth and colour. Not sure if that has anything to do with the issue. I am not sure if it is because of lens distortion of Kinect 2 due to its wide angle view.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900