Iat455

Assignments

Home Assignments

Assignment 2

This assignment is broken into 3 parts. Each part should be completed as an "Effect" that is loadable and runnable using the example code presented in your workshops.

Part 1: Over and Under with Mattes

Create an effect that uses the webcam, a still image (loaded locally and automatically) and a matte image. You pick the images and you decide what the effect will be. Examples: a window shape, eye holes or a face cutout.

Use operators: mix, screen, overlay, multiply etc... whatever works best for your effect.

Include 4 controls for your effect that change the position (x, y), scale and rotation of your Matte image. Use appropriate value ranges so your effect is fun to use. You will have to set a transform before drawing your Matte image on the canvas.

How to use canvas transformations is explained here and here.

NOTE: you are required to "listen" for changes to the controls in your draw loop and ONLY redraw the matte image if the values of these controls have changed.

Part 2: Luma-key Matte Generation

Create an effect that will automatically generate a matte image from the webcam using the luma-key approach. You will need to find the brightness value of each pixel.

Include 1 control to determine the brightness threshold for the matte. Use 0-255.

Create a black and white matte with no grayscale values, output the result to your canvas.

Part 3: All Together Now

Copy the luma-key effect from part 2 but instead of generating a 1 bit BW matte, add an extra control for the "fuzziness" of the matte. This will determine the range of grayscale values you will allow. Example: a value of 0 would generate a Black and White Matte, while a value of 15 would generate a 4 bit grayscale matte.

Include the control from part 2 and an additional control to change fuzziness values, 0-255.

Output the matte image to another canvas object. In the original canvas output the webcam image overtop of a background image. You choose the image and load locally. Use any operator to blend the pixels between the two images.