0% found this document useful (0 votes)
539 views

Green Screen Background Remover Using CV System

The document describes a project report on developing a green screen background remover using computer vision (CV) techniques. The system removes the green screen background from images and videos uploaded by users and replaces it with a static background image selected by the user. The project uses OpenCV for computer vision processing and Django for the web framework with a MySQL database. It allows users to seamlessly composite foreground objects against substituted backgrounds.

Uploaded by

Subham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
539 views

Green Screen Background Remover Using CV System

The document describes a project report on developing a green screen background remover using computer vision (CV) techniques. The system removes the green screen background from images and videos uploaded by users and replaces it with a static background image selected by the user. The project uses OpenCV for computer vision processing and Django for the web framework with a MySQL database. It allows users to seamlessly composite foreground objects against substituted backgrounds.

Uploaded by

Subham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

1

PROJECT REPORT ON

“ GREEN SCREEN BACKGROUND REMOVER


USING CV SYSTEM ”
Submitted for the partial fulfillment of the requirement for the degree of

Bachelor of Technology
in
COMPUTER SCIENCE & ENGINEERING
By

SUBHAM DAS Reg. No: 190128718


SAURAV KUMAR Reg. No: 1901287171
AAKANKSHA KUMARI Reg. No: 1901287031

Guided By
Prof. Vikash Singh

GITA AUTONOMOUS COLLEGE BHUBANESWAR


FEBRUARY 2023
2

Department of Computer Science & Engineering

GITA AUTONOMOUS COLLEGE , BHUBANESWAR


Ref no:…………………… Date:…………………..

Certificate
This is to certify that the project report entitled “ GREEN SCREEN BACKGROUND
REMOVER USING CV SYSTEM ”
submitted by

Mr. SUBHAM DAS, Reg No. 1901287188

Mr. SAURAV KUMAR, Reg No. 1901287171

Ms. AAKANKSHA KUMARI, Reg No. 1901287031

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.

Prof. Vikash Singh Prof. (Dr.) Tarini Prasad


Panigrahy (Guide) (H.O.D., Dept. of CSE)
3

Department of Computer Science & Engineering


GITA AUTONOMOUS COLLEGE , BHUBANESWAR

ACKNOWLEDGEMENT

I express gratitude to Prof. Vikash Singh, project supervisor for his


guidance and constant support.
I also take this opportunity to thank Prof. (Dr.) Tarini Prasad Panigrahy,
head of Department, Computer Science & Engineering, for his
constant support and timely advice.
Lastly, words run to express my gratitude to all the faculties of the
CSE Dept.and friends for their support and co-operation, constructive
criticism and valuable suggestion during preparation of this project
report.

Thanking All…..

SAURAV DAS SAURAV KUMAR AAKANKSHA KUMARI


Reg. No: 1901287188 Reg. No: 1901287171 Reg. No: 1901287031
4

Abstract

A green screen is a backdrop against which footage is shot to later be


superimposed over a separately-filmed background in a visual effects process
called “chroma keying.” It is also known as chroma key compositing, color
keying, or simply keying..

This term describes removing the green screen background in post-production


using video editing software. When the green screen background has been keyed,
it'll be fully transparent..
6

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

3. Background Problem Statement 6

4. Working of the Project 7

5. System Description 8

6. Project Life Cycle 10

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

As previously mentioned, the pre-packaged background removers in OpenCV will not


be used. Instead, the below flow-chart outlines the method I’ll use:
4

.
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

3. Background Problem Statement


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 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

4. Working of the Project

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

The system comprises 1 major module with their sub-modules as follows:


 USER:
 Registration
- The user will need to register first to log in to the system.
- The details such as name, age, gender, address, phone number,
and Email-ID.
 Login
- The user can log in using their login credentials.
 Upload Image
o Green Screen Image
- The user can upload an image with the green screen.
o Background Image
- Also, need to upload the image that the user wants as
a background image.

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. Software Requirement

ii. Laptop or PC
 Python
 Sublime Text Editor
 XAMP Server
12

8. Code
1. Import all the necessary libraries.

2. Load the images or videos.

3. Resize the images and videos to the same size.

4. Load the upper and lower BGR values of green colour.

5. Apply the mask and then use bitwise_and


13

6. Subtract the bitwise_and from the original green screen image.

7. Check for matrix value 0 after subtraction and replace it by the second image.

8. You get the desired result.


14

9. Conclusion

The intertwined concepts of foreground detection and background


subtraction are among some of the most studied aspects of computer
vision. While many methods exists, a simple application of edge
detection and finding contours within an image provides a good basis.

Using OpenCV’s built-in functions, the approach used was able to


render background removal in real-time. Under ideal conditions, the
algorithm worked near flawlessly, but some additional tweaking may
be needed for complex or busy backgrounds.
15

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/

You might also like