1

I have developed a solution with AR foundation which puts on a face mask when users show their face in camera, I want to implement this in image as well, but I am unable to find any useful functions in AR Foundation which detects face in an image selected from the local gallery. How do I go about implementing this functionality?

2 Answers2

0

I searched a bit and found the following links/suggestions you might find helpful:

OpenCV (Open Source Computer Vision) — one of the world’s most popular and widely used Computer Vision Libraries — which makes use of your webcam for real-time movement detection. The library is cross-platform and free for use under the open-source BSD license.

OpenCV ships out-of-the-box with pre-trained Haar cascades that can be used for face detection

For that, you can take a look at OpenCV for Unity. It's an Assets Plugin for using OpenCV 4.5.0 from within Unity.

It's about transforming the collected 3D face mesh vertices to 2D image coordinates.

Asol
  • 349
  • 3
  • 9
  • Thanks for your inputs, Asol, but i am trying to find a solution without having to use OpenCV for Unity, AR Foundation is already able to detect a face in real time, I am just trying to find a way to apply this to images selected from local Gallery. – Venkatesh Kk Mar 31 '21 at 10:16
0

The simplest way to detect faces in Unity is to use its Packages. Go to package manager and Install AR Foundation and ARCore XR plugin. You do not need to write any C# script for simple AR Face Detection. In Hierarchy you will find an option AR Default Face

For iOS install ARKit Face Tracking Package.

Shakir Sadiq
  • 64
  • 1
  • 5