2

I doing faceswap app using OpenCV and let's say I've found 2 faces in the picture and then I've cropped the face rectangles with ellipse. My problem is that both of these faces have different skin color so if I just simply swap the coordinates of the ovals, the result doesn't look so good. So I was thinking at least about adjusting the color of the face according to the original face.

I believe it is possible to achieve with OpenCV library but I just don't know the name of the method I should look for. Also it is important that the method is fast enough because I am developing this application for Android.

cmd
  • 11,622
  • 7
  • 51
  • 61
skornos
  • 3,121
  • 1
  • 26
  • 30
  • maybe you can use something of those answers: http://stackoverflow.com/questions/22315904/blending-does-not-remove-seams-in-opencv/ – Micka Apr 22 '14 at 09:57

1 Answers1

7

I think EM recoloring should be a good start point. Also take a look at poisson blending.

Hadi
  • 5,328
  • 11
  • 46
  • 67
Andrey Smorodov
  • 10,649
  • 2
  • 35
  • 42
  • Thanks for the suggestions, these methods seem to do exactly what I was looking for. But on the other hand aren't there any other methods that for example wouldn't produce such great results but they would be faster? In the worst case scenario I was thinking that I would skip these blending techniques if they weren't fast enough and I would swap faces according to the similarity of their color histogram. In that case is there any OpenCV function to compare the similarity of histograms? :] thanks for the response – skornos Apr 18 '14 at 16:40
  • 1
    You can measure hist similarity using compareHist method. See http://docs.opencv.org/doc/tutorials/imgproc/histograms/histogram_comparison/histogram_comparison.html – Andrey Smorodov Apr 18 '14 at 17:06