Grader: Maneesh Agrawala
2. One of the most important imaging operations used in computer graphics is compositing. Compositing operators allow multiple elements to be combined into a single composite image.
2A. (5 points) Suppose each pixel in a foreground image has color Cf = (Rf,Gf,Bf) and alpha Af, and each pixel in the background image has color Cb = (Rb,Gb,Bb) and alpha Ab. Alpha represents the percentage of each pixel covered by the image. Assume that alpha has not been premultiplied into the color. Write and expression for C = Cf OVER Cb:
2B. (15 points) In class we described a method called blue-screening that makes it possible to separate a foreground from a blue background. This procedure is actually fairly tricky and involves heuristics, because the number of unknowns (Rf,Gf,Bf,Af) is greater than the number of knowns (R,G,B).
Suppose however, that you take two pictures, each of the same foreground, but overlayed different backgrounds. Suppose the 1st picture results in a pixel color C1 = (R1,G1,B1) and was over a background color (Rb1,Gb1,Bb1), and the 2nd picture results in a pixel color C2 = (R2,G2,B2) and was over the background color (Rb2,Gb2,Bb2). Since the background is opaque, the alpha is equal to 1. Can you compute the foreground color and alpha (Rf,Gf,Bf,Af) from this information?
Copyright © 1997 Pat Hanrahan