MediaPipeUnityPlugin icon indicating copy to clipboard operation
MediaPipeUnityPlugin copied to clipboard

How to extract the data from eventArgs.value in HolisticTrackingSolution

Open Ishihara-Masabumi opened this issue 2 years ago • 2 comments

Plugin Version or Commit ID

v0.11.0

Unity Version

2021.3.18f1

Your Host OS

Windows10

Target Platform

Windows Standalone

Description

I need Face, Pose and Hands normalized landmark data. Please tell me how to extract those data from eventArgs.value in HolisticTrackingSolution?

Code to Reproduce the issue

No response

Additional Context

No response

Ishihara-Masabumi avatar Jun 29 '23 08:06 Ishihara-Masabumi

im looking for the same think

ManuelRibeiro89247 avatar Sep 05 '23 16:09 ManuelRibeiro89247

@Ishihara-Masabumi . Have you tried something like this? you'll need a different one for each type of output. the example below handles output of type OutputEventArgs<NormalizedLandmarkList> eventArgs

public Vector4[] LandmarksToVector4(NormalizedLandmarkList nll)  // where nll = eventArgs.value of LandmarkDetection output
{ 
            var landmarks = nll.Landmark;
            var vectorpoints = new Vector4[landmarks.Count];
            for (int i = 0; i < landmarks.Count; i++)
            {
                var landmark = landmarks[i];
                vectorpoints[i] = new Vector4(landmark.X, landmark.Y, landmark.Z, landmark.Visibility);
            }
            return vectorpoints;
            }

Ale1 avatar Oct 17 '23 09:10 Ale1