Stopping overlapping images in opencv web cam view

I’m trying to create some virtual puzzles that players can solve using their hands. web cam open and it shows our video the puzzle is on the screen and we can solve the puzzle. but moving the images, there are going overlapping. can you guys know how to stop it? if need I can supply the code