- Home /
Face detection in Unity
I would need help with a task we need to do for one of our project. We would simply need to detect a face in a webcam image on a PC, so we can cut the face from the image and paste it on another image. It does not need to be realtime, but it could be useful. We don't have much time for this, so it would need to be easy enough to implement.
I know the topic has been talked about a bit here, but we have difficulties finding an easy solution to this task. I've seen some YouTube videos of face tracking plugins in Unity, but all of them seem impossible to find on the internet. Vuforia doesn't have a face tracking solution. The Face Tracking Starter Kit works only with a Kinect. Face API for a commercial project is way too expensive. This leaves us with very few options.
If someone would be kind enough to give us hints for a potential solution, it would be very appreciated.
Face tracking in Unity is no different that in any other environment. Simply find a simple face tracking technique (face tracking is never simple) and implement it. We can't do your work for you.
Real-Time shadows are not an easy thing to implement, but it's made easy in Unity. Pathfinding is not an easy thing to implement, but it's made easy in Unity. An extensive UI system is not an easy thing to implement, but it's made easy in Unity and in some Asset Store packages. I could go on with this for a while, but I think you get my point.
Someone could have known a simple way that I didn't find on the internet, paid or not, but I guess such a solution does not exists under 4000$ per app (FaceAPI).
It might also depends on how much accuracy you are after. Is it a project for learning or a commercial project? If just for learning then the idea could be "just" to place vertices on points, specific point you define proably based on heightmap of a picture, looking for specific point for example that reflect more like due to their orientation or the edge of the eyes or eyebrows. Those are fairly easy since they have an abrupt change of color. Then join them in triangles to create a mesh.
Then comes the complicated part, comparing the new mesh with existing meshes considering a margin for each vertex...
All in all, this is not an answer since it takes more than that to develop but if you did not know where to start, that could lead somewhere...
Answer by tanoshimi · Mar 25, 2014 at 01:42 PM
Did you try EmguCV?
EmguCv works better but beware that documentation for it is too bad and would need a lot of exploration. Ins$$anonymous$$d learn the technique from openCV and try to replicate it in EmguCv.
to integrate it in to unity3d you need to do a lot of work.
I'm looking at EmguCV at the moment, I will see what I can do with that. I know that it won't be trivial, but if I can make this work in a week or two, it will be good enough for me.
Your answer
![](https://koobas.hobune.stream/wayback/20220613141055im_/https://answers.unity.com/themes/thub/images/avi.jpg)