A short demo on how to use OpenCV segmentation tools to segment foreground objects in a video.
The resulting mask is used to change the image background, replacing it with an arbitraty image. I recommend to save the hand image along with its mask. Then, generate several images with different backgrounds.
Run in your terminal:
python3 vidseg.py