2
$\begingroup$

I am developing a physioterapy system with kinect and need to scale a skeleton size to another skeleton size.

The kinect sensor recognizes 20 body joints, of every joint i have the x, y, and z positions. So, lets say i have the point A(-2, 3, 4) and want to move this point to the location B(4, -5, 2)

Actualy, i am using phytagoras to get the distance between one pairs of the joints of the origin skeleton, and the DestinySkeleton. For example, lets try to scale the points between Head and shoulder center:

howMuchScaleToX = Math.Sqrt(Math.Pow((skToBeScaled.Joints[ShoulderCenter].Position.X - skDestiny.Joints[Head].Position.X), 2)) * -1; howMuchScaleToY = Math.Sqrt(Math.Pow((skToBeScaled.Joints[ShoulderCenter].Position.Y - skDestiny.Joints[Head].Position.Y), 2)) * -1; howMuchScaleToZ = Math.Sqrt(Math.Pow((skToBeScaled.Joints[ShoulderCenter].Position.Z - skDestiny.Joints[Head].Position.Z), 2)) * -1; 

Now i think i have the distances to scale for each dimension (x, y, z). Now i just add this values to the skeleton to be scaled

skToBeScaled.Joints[Head].Position.X = skToBeScaled.Joints[Head].Position.X + howMuchScaleToX skToBeScaled.Joints[Head].Position.Y = skToBeScaled.Joints[Head].Position.Y + howMuchScaleToY skToBeScaled.Joints[Head].Position.Z = skToBeScaled.Joints[Head].Position.Z + howMuchScaleToZ 

But this approach are not working

  • 3
    Add $(6,-8,-2)$? Scale by $-2$ and then add $(0,1,10)$? There are infinitely many possibilities unless you explain more what you mean.2012-11-27

1 Answers 1

1

Usually you would pick one point as the origin and measure all others relative to it. Then to scale, you just multiply all the coordinates by your scaling factor. So if the left foot is your origin, it is at $(0,0,0)$. Then if the original right ankle is at $(1,.2,.1)$ and you scale up by $1.2$ the new right ankle is at $(1.2,.24,.12)$. Is this at all what you mean?

Added: The origin can be where you want it. The factor is how much larger you want the output than the input and is the same for all points. It is like using the enlarge/shrink button on a copy machine. If you use different scale factors for each point, or each coordinate, it will change the shape of the object, which is not usually desired in scaling. You can certainly measure the distance between any pair of points, which will get scaled by the factor, but that just happens by multiplying all the coordinates by the scale factor.

  • 0
    Acctualy this is my code, i have some issues yet. http://stackover$f$low.com/questions/13596331/kinect-skeleton-scaling-strange-behaviour2012-11-28