I’m working on a project using vvvv gamma and MediaPipe to detect hand landmarks and send this data to Wekinator via OSC. However, I’m having trouble normalizing the landmark sizes to make the data independent of the hand’s distance from the camera.
Here’s what I’ve done so far:
I’ve successfully retrieved the landmark coordinates from MediaPipe into vvvv gamma.
What I’m trying to achieve:
Normalize the hand size: I’d like to center the landmark coordinates around a reference point (e.g., the wrist) and scale them based on the distance between two points (e.g., wrist and middle fingertip) so the data remains consistent regardless of the hand’s distance from the camera.
Questions:
What nodes should I use in vvvv gamma to calculate the distance between two points and normalize the others relative to this distance?
How can I apply this transformation to all points at once so the process is dynamic and works in real-time?
Here is an example with the rendering of a hand at 50 cm from the webcam and another at 200 cm; the size is different, and I would like to normalize them to always have the same hand size at any distance.
Does anyone have an idea on how to normalize the points?
About normalizing: You can just chose one of the joints of your tracking data and subtract its position from all other joints. The reference point will then always be 0 and the others rotate around it.
Thank you, I managed to set the reference point to 0. But I’m still struggling to normalize the Z position. Mediapipe returns XY data, but Z is given as 0. The hand appears to grow or shrink depending on the movement along the Z axis. Do you have any ideas on how to normalize Z?
i’d say this should actually work but only if you can guarantee that the distance middle-finger tip to wrist is alwas the longest: you take the Distance node and feed it the wrist and the middle fingertip. this is your max-distance that will equal 1.
then for each of the points you do: Distance(point, wrist) / max-distance and use that length to scale the normalized directional vector between each point and the wrist.