Professional Documents
Culture Documents
CS5245 Vision and Graphics for Special Eects Leow Wee Kheng Department of Computer Science School of Computing National University of Singapore
Digital Compositing
1 / 67
Introduction
Introduction
Digital compositing means digitally manipulated integration of at least two images to produce a new image. The new image must appear realistic. It must be completely and seamlessly integrated, as if it were actually photographed by a single camera.
Digital Compositing
2 / 67
Introduction
Digital Compositing
3 / 67
Introduction
Rig Removal
Remove unwanted elements in footage.
Alpha Blending
Blend foreground elements with new background footage.
Digital Compositing
4 / 67
Alpha Blending
Alpha Blending
Basic equation C = F + (1 )B F : foreground image B: background image C : composite : opacity or transparency matte: an image of values The above operation is performed on each corresponding pixel. If = 1, then C = F , foreground is shown, i.e., foreground is opaque. If = 0, then C = B, background is shown, i.e., foreground is transparent. 0 < < 1: semi-transparent, e.g., shadow, smoke, etc.
Leow Wee Kheng (CS5245) Digital Compositing 5 / 67
(1)
Alpha Blending
Example: No Background B.
foreground F
matte
composite C
Digital Compositing
6 / 67
Alpha Blending
foreground F
matte
background B
Leow Wee Kheng (CS5245)
composite C
7 / 67
Digital Compositing
Alpha Blending
foreground F
matte
background B
Leow Wee Kheng (CS5245)
composite C
8 / 67
Digital Compositing
Alpha Blending
Important Notes of shadow should take intermediate value (0 < < 1). Otherwise, shadow looks unreal.
Digital Compositing
9 / 67
Alpha Blending
at boundary should also take intermediate value. Otherwise, have dark fringes. Good matte has intermediate at boundary and in shadow.
Digital Compositing
10 / 67
Alpha Blending
Digital Compositing
11 / 67
Alpha Blending
Create a comp with matte, foreground, and background stacked in layers. Composite using luminance-based track matte.
Digital Compositing
12 / 67
Keying
Keying
Separate foreground elements from background elements, creating a matte of foreground. Also called pulling a matte (of foreground), or keying out (i.e., making transparent) background. Recall: A good matte has intermediate in shadow and along object boundaries.
Digital Compositing
13 / 67
Keying
Dierence keying
requires clean plate, i.e., background image without foreground element.
Digital Compositing
14 / 67
Keying
Basic Ideas Compute dierence between foreground and background (based on luma, chroma, or color). Map dierence value to . Very small di = 0. Very large di = 1. Intermediate di intermediate .
Digital Compositing
15 / 67
Color Keying
Digital Compositing
16 / 67
Color Keying
Select foreground, then select Eect Keying Color Key. Use dropper to select Key Color. Set Color Tolerance amount.
Digital Compositing
17 / 67
Color Keying
Digital Compositing
18 / 67
Color Keying
Digital Compositing
19 / 67
Color Keying
Digital Compositing
20 / 67
Color Keying
Select foreground, then select Eect Keying Keylight. Use dropper to select Screen Colour for keying. Screen Balance is adjusted automatically.
Digital Compositing
21 / 67
Color Keying
Keylight performs color keying as follows: Compare intensities of primary components of a pixel and screen color. If small di, set = 0: transparent background pixel
If large di, set = 1: opaque foreground pixel If moderate di, set intermediate : semi-transparent edge pixel
Leow Wee Kheng (CS5245) Digital Compositing 22 / 67
Color Keying
Digital Compositing
23 / 67
Color Keying
White: opaque Black: transparent Gray: semi-transparent Car window is not very transparent. Hands and steering wheel are a bit transparent. Need to x transparency problems.
Leow Wee Kheng (CS5245) Digital Compositing 24 / 67
Color Keying
Digital Compositing
25 / 67
Color Keying
foreground image
background image
Digital Compositing
26 / 67
Color Keying
increase gain
default = 100
Digital Compositing
27 / 67
Color Keying
decrease gain
Digital Compositing
28 / 67
Color Keying
Screen Balance
default
Digital Compositing
29 / 67
Color Keying
Click Black Dierences below Click Black are assigned = 0. Result: Aected foreground pixels become totally transparent.
Digital Compositing
30 / 67
Color Keying
default = 0
Digital Compositing
31 / 67
Color Keying
Click White Dierences above Click White are assigned = 1. Result: Aected foreground pixels become totally opaque.
Digital Compositing
32 / 67
Color Keying
Clip White
default = 100
more opaque
Digital Compositing
33 / 67
Color Keying
Status
Matte
Digital Compositing
34 / 67
Color Keying
Final comp:
Digital Compositing
35 / 67
Color Keying
(a) (a) Hair looks blue or purple. (b) Skirt has blue color.
Leow Wee Kheng (CS5245) Digital Compositing
(b)
36 / 67
Color Keying
Key out blue screen using Keylight and blend with background. Example images from Merlin (1998).
Digital Compositing
37 / 67
Color Keying
(b)
Digital Compositing
38 / 67
Color Keying
(d)
Color Keying
Sometimes, the blue/green screen may be poorly done. Example: from Executive Decision (1996). The green screen has more red than green!
Digital Compositing
40 / 67
Color Keying
Digital Compositing
41 / 67
Color Keying
To x the problem, need to tell Keylight to scale down red component so that the green component is the most prominent. Check check-box for Lock Biases Together. Select skin color for Despill Bias using dropper. Need to select from Source view, i.e., input image. Alpha Bias is selected automatically.
Digital Compositing
42 / 67
Color Keying
Pilots mask is transparent. Cockpit glass canopy is not totally transparent. Need to x transparency problems.
Digital Compositing
43 / 67
Color Keying
Digital Compositing
44 / 67
Color Keying
Digital Compositing
45 / 67
Color Keying
There are some spots on the foreground and background, most apparent in the Matte view.
Digital Compositing
46 / 67
Color Keying
Increase Screen Despot Black and Screen Despot White to remove spots.
Digital Compositing
47 / 67
Color Keying
Handling Fringes
Handling Fringes
Sometimes, adjusting Clip Black and Clip White can produce fringes. Adjusting Screen Gain usually doesnt produce fringes.
Digital Compositing
48 / 67
Color Keying
Handling Fringes
One method of removing fringes is to shrink the screen matte. Set Screen Shrink to small negative value.
Digital Compositing
49 / 67
Color Keying
Handling Fringes
Digital Compositing
50 / 67
Dierence Keying
Dierence Keying
Key out background based on pixel-wise color dierence between foreground and background footage. Can be used when: Blue screen is imperfect. Background is not of uniform color.
Digital Compositing
51 / 67
Dierence Keying
Digital Compositing
52 / 67
Dierence Keying
Digital Compositing
53 / 67
Dierence Keying
If screen correction is imperfect, can use guide lines to limit area to be blended.
Digital Compositing
54 / 67
Dierence Keying
Final comp:
Digital Compositing
55 / 67
Rig Removal
Rig Removal
Rigs are equipment that support the actors or props. Sometimes, rigs cannot be removed by keying alone. So, have to apply masking technique to remove rigs. Need clean plates of background footage. If camera moves, then need motion-controlled camera. Computer controls camera to move the same way twice:
Without foreground objects; get clean plates. With foreground objects.
Basic Idea: Apply a mask to mask out the rig. Replace pixels in masked area by corresponding pixels in clean plate. If rig moves, then animate the mask accordingly.
Leow Wee Kheng (CS5245) Digital Compositing 56 / 67
Rig Removal
Digital Compositing
57 / 67
Rig Removal
Step 1: Align Clean Plate Check misalignment between foreground and clean plate. Motion-controlled camera cant be perfect. Dierence of foreground and clean plate can reveal misalignment.
Digital Compositing
58 / 67
Rig Removal
Translate clean plate to align. Use real number coordinates get more precise alignment. Have to set layer quality to Best.
Digital Compositing
59 / 67
Rig Removal
Digital Compositing
60 / 67
Rig Removal
Step 2: Mask Out Rig Lock clean plate to avoid accidental change of position. Put a mask over rig, include rig shadow. Set mask mode to Subtract.
Digital Compositing
61 / 67
Rig Removal
Digital Compositing
62 / 67
Rig Removal
Oval shaped mask may not work in general. May mask out part of foreground element.
Need to manually set the mask shape. Rotoscoping: manually set outline of mask, matte, or foreground.
Digital Compositing
63 / 67
Rig Removal
3. Animate Mask Move mask to cover rig in subsequent frames. Make large mask to minimize the number of keyframes that need rotoscoping.
Digital Compositing
64 / 67
Rig Removal
Digital Compositing
65 / 67
Summary
Summary
Further readings and exercises: Other miscellaneous topics in compositing [Kel00]. Adobe After Eects CS4 User Guide [Aft]. Keylight User Guide [Key]. Do the tutorials in Keylight User Guide. Download test images from The Foundary [Fou].
Digital Compositing
66 / 67
References
References
After Eects CS4, www.adobe.com/products/aftereects/. The Foundary, www.thefoundry.co.uk. D. Kelly. Digital Compositing In Depth. Coriolis Group, 2000. Keylight, www.thefoundry.co.uk.
Digital Compositing
67 / 67