Are you a potter head, if yes i have something which you would love to built or recreate.

Are you a Potter Head , i have something which you would love to built or recreate -Invisibility Cloak. Yes! It’s the cloak that makes Harry Potter invisible one of the 3 Deathly Hallows. We will make this happen with OpenCV.

Image for post

A gift from the death

How will this work ?

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! We are using cloth of different colors as our cloak how can you change to different colors will be all your choice you can use red same as harry potter had.

  1. Capture and store the background frame.
  2. Detect colored cloth using color detection algorithm.
  3. Segment out the colored cloth by generating a mask.
  4. Generate the final augmented output to create the magical effect.

Image for post

Libraries to be used:

  1. cv2
  2. numpy
import cv2
import numpy as np

Capturing Background

We have to replace the current frame pixels corresponding to the cloth with the background pixels to generate the invisibility. For this, we need to store a frame of the background.

#invisible #opencv #harry-potter #python #invisible-cloak

Invisible Cloak and How will this work ?
2.10 GEEK