hrastnik / FaceSwap

Real-time FaceSwap application built with OpenCV and dlib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Color artifacts when histograms of the faces are not similar

ebroglio opened this issue · comments

Great project, it is working really well. But I see color artifacts when the lighting of the faces is not the same. There is a paper which addresses this problem in histogram matching: https://www.researchgate.net/profile/Frederik_Zilly/publication/243457773_PRESERVING_DYNAMIC_RANGE_BY_ADVANCED_COLOR_HISTOGRAM_MATCHING_IN_STEREO_VISION/links/0deec51d1b71be896a000000.pdf Maybe you can have a look at it.

I am aware of the artifacts when swapping faces with drastically different lighting (for example, if you swap face with a face on your phone screen it gets really weird) but the general idea is that the two faces are going to be in the same room and in the same lightning conditions and the histogram matching works good enough as it it. Besides, this was a hobby project that I'm unlikely to be improving.

If you wish you can implement this yourself and submit a PR,,, I will gladly accept it, but I'm not planning on doing additional work on the project myself.

I am using seamlessClone function in opencv to delete the different between two images when swap, but it is very slow.
Is using histogram matching faster than seamless clone in opencv?

Yes, histogram matching is faster.

@ebroglio -- mind if I ask how you actually got it to compile? What commands do you use?