ee150_chromakey - EE 150 Lab 6 Chroma Key 1 Introduction In...


View Full Document Right Arrow Icon
Last Revised: 11/7/2008 1 EE 150 Lab 6 Chroma Key 1 Introduction In this lab you will perform a blue-screen (or green-screen) operation. You will be given an input image (e.g. Stephen Colbert) with a blue or green background referred to as the chroma key. You will filter out the chroma key portions of the image and replace them with the corresponding portions of a new background image (e.g. USC campus). This technique is frequently used in the TV, movie, and digital imaging industries. Green-Screen Image 1 Background Chroma-Key Result 2 What you will learn This lab exercise will expose you to simple image representation and manipulation techniques as well familiarize you with C/C++ operations on 2D arrays (matrices) and file I/O. 3 Background Information and Notes Image processing is a major subfield of electrical engineering and to a lesser extent biomedical engineering. Graphics are usually represented via two methods: vector or bitmap. Vector graphics take a more abstract approach and use mathematical equations to represent lines, curves, polygons and their fill color. When a program opens the vector image it has to translate those equations and render the image. This vector approach is often used to represent clipart and 3D animations. Bitmap images take the opposite approach and simply represent the image as a 2D array of pixels. Each pixel is a small dot or square of color. The bitmap approach is used most commonly for pictures, video, and other images. In addition, bitmaps do not 1 Image taken from
Background image of page 1


View Full DocumentRight Arrow Icon
EE 150 Lab 6 - Chroma Key 2 Last Revised: 11/7/2008 force us to translate the vector equations, and thus are simpler to manipulate for our purposes. Color bitmaps can use one of several different color representations. The simplest of these methods is probably the RGB color space (HSL, HSV, & CMYK are others), where each pixel has separate red, green, and blue components that are combined to produce the desired color. Usually each component is an 8-bit value (unsigned char in C). Given 3-values this yields a total of 24-bits for representing a specific color (known as 24-bit color = 2 24 = 16 million unique colors). Storing a red, green and blue value for each pixel can be achieved using 3 separate 2D arrays (one for each RGB component) or can be combined into a 3D array with dimensions [256][256][3] as shown below. [Note: BMP image files use a simple format like this one and thus will be the file format used in our lab.] (0,0) (0,255) (255,255) (255,0) (0,1) (1,0) (1,1) R = Image[i][j][0] G = Image[i][j][1] B = Image[i][j][2] R G B Red Green Blue Figure 1 - Representation of a color bitmap as a 3D array The primary task in performing the chroma key operation is to determine which pixels of the image are the chroma key (green/blue). Part of the problem is that shadows and other artifacts may make the background pixels significantly lighter or darker shades of the key color, especially the closer they are to the foreground
Background image of page 2
Image of page 3

Page1 / 9



View Full Document Right Arrow Icon
Ask a homework question - tutors are online