Visual Echo Cancellation - Photometric Calibration

Does anyone know of an open source solution for visual echo cancellation using photometric calibration or possibly some other method?

I am projecting onto a surface while also capturing that surface with an RGB camera. The camera picks up the projected content and creates an echo effect, which I want to eliminate.