-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
How to convert mediapipe coordinates into Unity world space coordinates? #676
Comments
I have been trying to use mediapipe with Unity as well and was wondering do you have mediapipe running within Unity or are you getting the landmarks somewhere else and then sending it to Unity? |
@CalebGreer, i'm building aar (android archive library) and use it as plugin for Unity |
@BoneFlat Oh, I had tried that but couldn't get it to work. Would you mind sharing your solution or how you got the aar to work within Unity? |
@CalebGreer, i'm following "the left" solution at #36 (comment). |
Now, i'm ok with x and y in image coordinates but with the depth, i still have no idea |
Hey @BoneFlat, |
i'm considering that how to stream a byte array from unity webcam to mediapipe ? Any solution? Thank you. |
@BoneFlat did you make any progress on this? |
Sorry all for the late answer, i made a simple project that show how to use mediapipe with Unity, i also made a unity package, you can use this for another project. You can found all here: https://gitlab.com/thangnh.sas/mediapipe-unity-hand-tracking |
I made a solution to solve the depth and made a simple game base on that here: https://gitlab.com/JackieNek/single-hand-tracking . You can see demo here: https://youtu.be/paZ3sXtKTq8 |
@BoneFlat : in your ARHand.cs file I found this code: Would you be willing to share how you determined that those formulas were correct? X - 0.5f * (1 - c)) / c Were these specific to camera calibration on your particular camera device ? |
Thank you in advance guys. |
is it possible to build analogically build the media pipe as a |
All very cool! @BoneFlat |
@BoneFlat Thank you ! The package is working like a charm. The only drag i have seen in FPS... i feel this has to be taken up to run over the GPU for better performance. |
@sachinjambhulkar could you describe in detail how you implemented it? |
@danieljtrujillo clone the repo: https://gitlab.com/thangnh.sas/mediapipe-unity-hand-tracking. navigate to the base directory of this project, right click over the file "MediapipeUnityPackage.unitypackage" and open with the Unity. You can observe the complete project with all assets getting imported to unity Editor. Open the SampleScene.unity and you can make it run on your preferred platform / end device target. |
@brianm-sra Do you have any ideas about the formula? |
@JackieNek @BoneFlat do you know why i cant show the hand bone in my android phone? |
are you sure this demo can show hand bone? |
@BoneFlat Hi thanks for this package its great |
Hi MediaPipe Team, i'm trying to convert 21 landmarks into unity 3d world space.
I follow these step to do that:
Step 1: I follow @eknight7 instruction from #454 to get NormalizedRect in image coordinates.
Step 2: Because "NormalizedLandmark" is landmark location in HandRect coordinates, so i can convert 21 point into image coordinates.
Step 3: I'm using "ScreenToWorldSpace" method in Unity to convert 21 point in image coordinate to 3d world space with a specifi depth (depth = 3 in my case).
But the final result in Unity has a little discrepancies , you can see in image below.
Can you give me some advise to convert the landmarks. And i also want to know is there a solution to get the real depth?
The text was updated successfully, but these errors were encountered: