Green Screen Background Remover Using CV System
Green Screen Background Remover Using CV System
PROJECT REPORT ON
Bachelor of Technology
in
COMPUTER SCIENCE & ENGINEERING
By
Guided By
Prof. Vikash Singh
Certificate
This is to certify that the project report entitled “ GREEN SCREEN BACKGROUND
REMOVER USING CV SYSTEM ”
submitted by
is an authentic work carried out by him/her at GITA under my guidance. The matter
embodied in this project work has not been submitted earlier for the award of any degree or
diploma to the best of my knowledge and belief.
ACKNOWLEDGEMENT
Thanking All…..
Abstract
TALBLE OF CONTENTS
1. Introduction 1
2. Green Screen 3
2.1 Definition 3
2.2 Algorithm 3
2.3 Advantages 4
2.4 Challenges 5
5. System Description 8
7. System Requirement 11
8. Code 12
9. Conclusion 14
Reference 15
1
1. Introduction
A green screen is a key component in a film and television production process known
as “chroma keying,” in which foregrounded action is combined with separately filmed
or constructed background footage. The process works by a person in front of bright
green backdrops, then isolating and removing that green colour range, and replacing it
with a different background. So, the green screen is a large green backdrop placed in
the background of a shot to allow for digital effects later.
Our Green Screen Background Remover System removes the green screen from the
original image and adds a static image as a background to the uploaded image and
video using OpenCV. It allows for exciting and otherwise-impossible scenarios to be
produced, expanding the possibilities.
In this system, the user will need to register first to log in to the system. The user can
upload an image with the green screen and the image that they want as a background,
then the system will remove the green screen background. As a result, the image will
then be displayed to the user with the uploaded background image.
2
The user can also upload a video with a green screen background and the image for the
background. Only static images can be set as a background images. The results will
then be displayed to the user with the uploaded background image in a video. The front-
end involves Html, CSS, and JavaScript and the back-end involves Python. The
framework used is Django and the database is MySQL. Here, we have implemented
the OpenCV library.
We live in the era of video calls. Conducted over the internet and using whatever camera
that comes with your laptop or computer, we broadcast our lives to our classmates,
coworkers, and families. Sometimes, though, we don’t want to broadcast our space. My
office, like many others, has a few perennial pieces of clutter. I also have a guitar on the
wall behind me, which doesn’t always scream professionalism. As a result, Zoom and
other video calling software includes a feature to hide your background, usually behind an
image of your choice. While most don’t think of it much, the actual task of determining
what determines the foreground and the background in an image is hardly trivial.
It may seem like convincing green screen effects are out of reach for the average video
producer, but in fact, with some knowledge, time and preparation, anyone can create
believable effects using this technique. But before you get started on your next epic
masterpiece, let’s take a look at how green screening actually works. Green screen is
industry shorthand for a process called chroma keying. This process is used to composite
two images together based on color hues. Chroma keying lets you remove a specific color
from your image to allow another image to show through from behind. This background
image is called a plate, and the more your keyed footage blends in with this plate, the
more believable your effects will be.
3
2. Green Screen
2.1 Definition
A green screen is a large green backdrop placed in the background of a shot to allow for
digital effects later. In Post-Production, the special effects department will edit the
background from green to… anything they want with CGI (computer-generated
imagery) or background footage called "plates." The screen can take up the entire
background or just a portion of it, depending on what needs to be replaced.
2.2 Algorithm
.
First, we’ll take the image and convert it to black and white. Next, edge detection will
be applied and the contours in the image will be found. Any contours that are too either
too big or too small to be the foreground will be removed.
The remaining contours will be considered the foreground. This makes some intuitive
sense, as especially small details in a busy background will generate very small
contours. By contrast, very large contours which take up most the screen probably
aren’t the foreground, but some visual artefact of the background.
Finally a mask is generated from the remaining contours and is blended into
the original image
2.3 Advantages
Using green screen, or chroma key technology, is beneficial in many ways. Using a green
screen allows the filmmaker to layer any background with the subject being filmed or
photographed. The subject is filmed against the green (sometimes blue) background, which is
replaced in post-production by a digitally generated background.
Besides the most palpable advantage to using a green screen, that is, the ability to produce
essentially any setting in a controlled environment (green screen studio), there are a number
of additional advantages to this technique.
5
First, shooting on a green screen instead of on-location saves time. Because the background
added is digitally generated, there is no need to travel beyond the studio to achieve a
desired setting. In addition to saving time, this is almost much more cost effective.
Filming and photographing in a studio instead of on-location ensures that the shoot will not
be delayed for reasons beyond the the filmmakers' control, such as weather conditions,
availability of certain locations, etc. The controlled environment provided by a green screen
studio ensures that external noise; lighting conditions, etc. do not have to be factored into the
filming process.
2.4 Challenges
The green screen is not new to video production and has been a tool used for
decades. It allows digital artists to alter the background of the video, using virtually any
image that is desired. The options that are available with a green screen are endless.
While a green screen provides many benefits, it can be challenging to work with, if you
don’t know what you are doing. The biggest challenges that people face with the green
screen are obtaining even lighting and avoiding shadows.
Ideally, you want to have as narrow a color range as possible. Even the material you
use to create the green screen can impact the lighting. For example, a shiny surface will
have areas that reflect the light, while a matte surface will diffuse reflected light and
produce a more even color range.
When shadows are created, they can appear as a darker color to the camera and their
placement may not be registered. You often see this problem in low-budget films.
6
The process works by a person in front of bright green backdrops, then isolating and
removing that green color range, and replacing it with a different background. So, the
green screen is a large green backdrop placed in the background of a shot to allow for
digital effects later.
Our Green Screen Background Remover System removes the green screen from the
original image and adds a static image as a background to the uploaded image and video
using OpenCV. It allows for exciting and otherwise-impossible scenarios to be produced,
expanding the possibilities.
7
In this system, the user will need to register first to log in to the system. The
user can upload an image with the green screen and the image that they want
as a background, then the system will remove the green screen background.
As a result, the image will then be displayed to the user with the uploaded
background image.
The user can also upload a video with a green screen background and the
image for the background. Only static images can be set as a background
images. The results will then be displayed to the user with the uploaded
background image in a video.
The front-end involves Html, CSS, and JavaScript and the back-end involves
Python. The framework used is Django and the database is MySQL. Here,
we have implemented the OpenCV library.
8
5. System Description
o Image Result
- The image result will be displayed to the user.
9
Upload Video
o Green screen video
- The user can upload a video with a green screen background.
o Background Image
- They will also need to upload an image for a background.
o Image Result
- The image result will be displayed to the user.
Buy and pay: Customers who buy through the app can pay through many different
payment gateways
10
6.Project LifeCycle
The waterfall model is a classical model used in the system development life
cycle to create a system with a linear and sequential approach. It is termed a
waterfall because the model develops systematically from one phase to
another in a downward fashion. The waterfall approach does not define the
process to go back to the previous phase to handle changes in requirements.
The waterfall approach is the earliest approach that was used for software
development..
11
7. System Requirement
I. Hardware Requirement
i.Laptop or PC
Windows 7 or higher
I3 processor system or higher
4 GB RAM or higher
100 GB ROM or higher
ii. Laptop or PC
Python
Sublime Text Editor
XAMP Server
12
8. Code
1. Import all the necessary libraries.
7. Check for matrix value 0 after subtraction and replace it by the second image.
9. Conclusion
Reference
- https://www.researchgate.net/figure/Background-subtraction-
response-after-adding-and-removing-items-from-a-scene-using-
OPENCV_fig6_228833527
- https://www.researchgate.net/figure/Input-1-for-green-screen-
removal_fig4_339328277
- https://runwayml.com/green-screen/