If you are a Harry Potter fan like me, you would know what an Invisibility Cloak is. Yes! It’s the cloak which Harry Potter uses to become invisible. Of course, we all know that an invisibility cloak is not real — it’s all graphics trickery.
In this repository, you will find the code to create our own ‘Invisibility Cloak’ using simple computer vision techniques in OpenCV and numpy.
The algorithm is very similar in principle to green screening. But unlike green screening where we remove the background, in this application, we remove the foreground!
- Capture and store the background frame [ This will be done for some seconds ]
- Detect the blue colored cloth using color detection and segmentation algorithm.
- Segment out the blue colored cloth by generating a mask. [ used in code ]
- Generate the final augmented output to create a magical effect.
1.Python(3)
2.Numpy
3.OpenCV
- Run the ipynb file in your jupyter notebook. (make sure to set the background first the backgroung must be still nobody is in front of the webcam.)
- A window will pop up showing the video.
- Now take a blue piece of cloth is front of the web cam and see the magic.