This Android app renders a 3D scene (made with Unity) using face tracking to move a virtual camera.
The Android Studio and Unity projects can be imported from the android
and unity
directories.
Basic flow:
FaceCamera.java
, detect the 2D position and size of a face using the front-facing camera.FaceCamera.java
, use OpenCV to reconstruct the face position in 3D space.UnityPlayerActivity.java
, serialize the camera pose using camera_pose.proto
and send it to the Unity scene.MoveCamera.cs
, deserialize the pose and apply it to the scene's camera.The 3D model in the scene is Coral Reef by Ashley Alicea.