How do you segment someone from there background in real time?

Basically I need help on trying to do this CGI Omegle Hacking - @Hyphonix - YouTube (Go to 20:52)

Essentially he is using a cgi script to track the faces of the people allowing the background to become transparent so he can appear behind them. Here is an article I found Realtime webcam CGI / AR with Blender + dlib+ OpenCV - Hackology

Im pretty sure thats the method on how to do this trick. But he explains it for linux if you can get this to work on windows that would be great!