hrastnik / FaceSwap

Real-time FaceSwap application built with OpenCV and dlib
MIT License
679 stars 188 forks source link

Color artifacts when histograms of the faces are not similar #1

Open ebroglio opened 8 years ago

ebroglio commented 8 years ago

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.

hrastnik commented 8 years ago

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.

vudangthinh commented 8 years ago

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?

hrastnik commented 8 years ago

Yes, histogram matching is faster.

SnakeO commented 7 years ago

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