Question
A picture taken in front of a green screen can be used to embed the subject of that picture into a background picture creating an
A picture taken in front of a green screen can be used to embed the subject of that picture into a background picture creating an entirely new picture. A program can do this by checking each pixel from the green-screen picture to see if the color at that pixel matches the green of the screen. If a match occurs, then that pixel is not used and the corresponding pixel from the background is copied as the pixel for the new picture. If the checked pixel is not the right shade of green, then that green-screen pixel is the one copied.
The Assignment
Write a program to take your choice of green-screen picture and embed the subject into a background picture.
Pictures
Pictures are available here.
Hints
1. Your program will be given the pictures as 2D arrays holding values for green, red, and blue. To determine if a pixel is GREEN, just check to see if the green value is greater than the red value and greater than the blue value for that pixel.
2.If you want to use your own pictures, the ones I have for you are 852 pixels wide and 480 pixels high. It will be easier if you scale your pictures to this size also.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started