Changing the visual when the data of one webcam overlaps with the second webcam

Hello, I want to make an interactive installation where the visual of the body would change whenever one person touches the other one on the screen. I’m using two webcams and I erased the background so it only captures the movement of the person and I made sure that the images overlaps a little bit so that the could touch each other on the screen. My question is : How can I get the data of the moment where they touch each other so the visual of their bodies only changes when they enter in contact ?