Skip to content

If you use a red piece of cloth in front of the camera it will make you look invisible. It was implemented using python opencv.

License

Notifications You must be signed in to change notification settings

Badsha1996/Invisible_man

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Invisible suit

This is a simple project based on python library opencv. Open the project, run it with python IDE. the give it some time to capture the backgroud. Use a red cloth to make yourself invisible.

Algorithm

The concept for this project is simple.

  • step:
  1. Capture the video image
  2. Create a mask
  3. New video start
  4. Replace it with the first video capture
  5. marks = marks1+marks2

Requirements

For running the project you need numpy, opencv and python3 installed in your system. First go to the python website. After downloading Pyhton3 open command line in your machine. Type pip install numpy and pip install opencv-python.

Creating masks

    import cv2
    import numpy as np
    ...................
    hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
    blur = cv2.GaussianBlur(hsv, (35, 35), 0)

    lower_range = np.array([0, 120, 70])
    upper_range = np.array([10, 255, 255])
    mask_1 = cv2.inRange(hsv, lower_range, upper_range)

    lower_red_range = np.array([170, 120, 70])
    upper_red_range = np.array([180, 255, 255])
    mask_2 = cv2.inRange(hsv, lower_red_range, upper_red_range)

    mask = mask_1 + mask_2
    mask = cv2.morphologyEx(mask, cv2.MORPH_OPEN, np.ones((5, 5), np.uint8))
    frame[np.where(mask == 255)] = replica[np.where(mask == 255)]

About

If you use a red piece of cloth in front of the camera it will make you look invisible. It was implemented using python opencv.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages