Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
2.99k stars 1.11k forks source link

How to get ARFace mesh coordinates on the ARcamera cpu image (Unity/ARFoundation) #1001

Closed AMMAS1 closed 9 months ago

AMMAS1 commented 1 year ago

I'm trying to use AR camera with face tracking to capture some vertices from the facemesh(and mask the area), and pass the image to opencv for unity to do further processing.

Vector3 screenPosition = arCamera.GetComponent<Camera>().WorldToScreenPoint(face.transform.position + face.vertices[0])

I'm using this but this returns the position relative to the screen which has a different aspect ratio than the image from "cameraManager.TryAcquireLatestCpuImage". (2340 x 1080) vs (640 x 480)

I tried looking every where how to transform the position from world to cpu image and tried to map the screen coordinates to the cpu image using displaymatrix and projectionmatrix but no luck.

Any solution would be appreciated!!

AMMAS1 commented 1 year ago

Bump

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

andyb-unity commented 9 months ago

Hi @AMMAS1, we aren't able to help you with this issue as this is beyond the scope of this repository. Feel free to ask your question on the forums or other community sites.