Assignments in CSE 130

Spring Quarter, 2007

Week 1 Read chapters 1 and 2. Chapter 1 is available. Chapter 2 is also available.

In groups of two, prepare and make a presentation about a visual illusion. Select an illusion from the set shown at Dr. Michael Bach's site: 71 Optical Illusions and Visual Phenomena. Choose one that nobody else in the class is doing. (Sign up at end of class on Monday.) For your illusion do the following: (a) create a small graphic, normally on a sheet of paper, but if necessary on the computer or at a web site of some kind; (b) tell the name of the illusion, what the observer is supposed to experience, and what instructions the observer needs to follow; (c) explain how it works, or why the human visual system reacts the way it does; (d) identify at least one authoritative reference that you used. If you used the Wikipedia or similar unreviewed publication, then be sure to identify another reference, one that is authoritative. In your presentation, you may use a computer, but it should be possible to load up and deliver your presentation in a total of 3 minutes. If you do use a computer, please bring your presentation on a Flash drive or on your own laptop. The presentations will be given during our lab period on Thursday.

Week 2 For Wednesday, April 4, do both Parts 1 and 2. Part 1: Answer all questions at the end of Chapter 2. To submit your answers, type them into a file and then submit it by making a reply in INFACT to the message whose subject is "Turn in Assignment 2, Part 1" and pasting your text into the body of your reply. The message is message number 112 in our forum.
Part 2: A. Upload an image of your choice to the INFACT file management facility on Socrates. It should be something you wouldn't mind sharing with the rest of the class. Also, it would be good if you have the legal rights to the image, in case there is an opportunity to "publish" it in some form, such as posting a version of it on the web. If you have an image that you really like, but you don't have the rights to it, you can still use it for this assignment.
B. Identify some key feature in the image that you will try to keep recognizable, such as the number of trees in front of the house, the fact that there is a person in the picture, etc. Then use PixelMath to produce a minimum-resolution version of that image in which that feature is still recognizable. Explain this minimum resolution in terms of Nyquist sampling.
C. Create a high-contrast monochrome version of your image. The result should be an image with only black pixels and white pixels. (Work from the original high-resolution version of the image --- not the result from Part B.) Try to maximize either the clarity of the representation or the aesthetic appeal of it. Explain both what operations you performed and how you chose them.
D. Create a re-colored version of the image by applying a PixelMath formula that alters the colors of the pixels. Try to come up with a formula that makes the resulting image visually most interesting. Note that one convenient type of formula for such a task involves a call to calculator function "RGB". For example,
RGB(Green1(x,y), Blue1(x,y), Red1(x,y))
performs a sort of "rotation" of the color components, so that the amount of green in a pixel becomes the amount of red in the pixel, and the amount of blue becomes the amount of green, and the amount of red becomes the amount of blue. You may also choose to work with formulas involving hue, saturation, and value of the colors. When you are satisfied with your formula, write that down as your answer, and then describe either what you were trying to do or what you did as you created it.
Turn in Part 2 by replying to the message having subject, "Turn in Assignment 2, Part 2". This is message number 113.
Read chapters 3 and 4. Chapter 3 is available. A preliminary version of Chapter 4 is available.
Week 3 (Part 1) Due Thursday: "Portfolio Project": Develop a collection of versions of your image including: (a) original; (b) monochrome (gray); (c) thresholded; (d) color -- hue rotated; (e) color -- boosted saturation; (f) fisheye with polar mode; (g) upside-down; (h) color negative; (i) big tiled version (2 x 2 array of different color effects); (j) OTHER -- your choice.

The portfolio should be done using the Formula Page interface. You should create a .pfp file in the Formula Page interface. We'll go over how to create these on Monday. Then post the contents of it in INFACT.

Part 2 (Due Monday, April 16 on INFACT by 11:59 PM): Exercises on color, geometric transformations, and groups. Reply to the message "Assignment 3, Part 2" with your answers.

Color:

RGB: Give a formula that will create a gradient of yellow (gradually going from black to yellow)
HSV: Give a formula what will map each color to one with complementary hue and complementary value, but the same saturation. Try this on an image that contains several colors, and describe the effect.

Geom: Give a formula that flips only the right half an image upside down, leaving the left half as it was.
Give a formula that brightens all the pixels in a 100 x 100 box centered in the image, but leaves the other pixels unchanged.
Give a formula that shifts all the pixels in the 100 x 100 box up by 20 pixels, but that shifts all the other pixels left by 30 pixels.
Group:
Make up a formula that will interchange the left and right halves of an image. Does this transformation generate a group? Explain your answer.
Give a formula that shifts the image up and right by one pixel. Does this transformation generate a group? Explain.
Consider the transformation: Hue rotation by 1/3. Is this invertible? Does it generate a group?

Read the new section of Chapter 4 on hue, saturation and value. The new version of Chapter 4 is now available. Read the brief Chapter 5, which describes the Pull method of image processing, which is what PixelMath and most other systems use.
Read Chapter 6, which covers certain types of image distortion.
Finally, read Chapter 7. This presents not only various kinds of symmetry, but also the theory of transformations, including invertibility, closure, associativeness of composition, and transformation groups.
Week 4 Practice viewing autostereograms. Here is how to get started.
Read Chapter 8 on synthesizing images, Chapter 9 on steregrams, and Chapter 10 on anamorphic images.
Due: Thursday morning, April 19 at 9:30: (a) Create a synthesized depth image containing two or more of the following, based the techniques in Chapter 8: distance transforms, cylinders, and spheres. (b) Create a carrier image in the following way: start with a digital image with lots of texture. Add 2 times the product of the x and y coordinates and take all this modulo 256. Divide the result by 255, and force the hue of the destination pixel to this value. Set the saturation of the destination pixel value to 1 and the value to 1 also. The formula should look something like this:
hsv(((S1(x,y)+(x*y)) mod 256)/255, 1, 1)
(c) Create a stereogram using your synthesized depth image and the carrier image. Adjust your stereogram however necessary to get a reasonably good stereo effect.
Week 5 Due: Thursday morning, April 26 at 9:30: (A) Polish the stereogram that you created in the last assignment. Do not use the carrier image provided in the instructor's demonstration, but use one that has something to do with the theme in your depth image. Adjust your depth image so that the effects show up well. Consider adding a "floor" to your depth image. Adjust either the size of your carrier image or the way it is referenced in the sterogram formula so that any key elements in that pattern are not cut off in an unnecessarily ugly way.
(B) Create a photomosaic using an image of a friend or family member. You may use two or more different images. One will be your low-resolution but large image, and the other(s) in the role of macropixels. You may also use one of the macropixel images available on INFACT, but the main image should be a new, personal one of your own. Make use of the handout of Monday, April 23 to help in the process.
 
Study for the midterm exam. Here are some sample questions. The exam will be closed-book, in-class on Monday, April 30.
Week 6 Reading: Chapters 15, 16, and 17: Automatic Processing. Python Basics. Control Structures: Conditionals and Looping. Due: Thursday morning, May 3 at 9:30 as a Python program uploaded to INFACT: Three transition effects.
Consider the examples of transition effects described in Chapter 17. A transition program for us will start out by loading two different images, possibly creating resized versions of them, and then going into a loop in which a third image window (the destination window) will undergo a serious of changes showing the transition effect. The transition should begin with Source image 1, and end with Source image 2, with a sequence of intermediate versions. Many transition effects in moviemaking are called ``wipes'' and may involve a line or curve moving across the screen opening the view of the second image through the first.
(1 and 2) First try creating your own version of two standard effects: a dissolve (or cross-fade), and a simple wipe in which a vertical line that divides the new image from the old moves from left to right on the screen until the full second image is displayed.
(3) Design a transition effect of your own. Try a variation on one of the examples. Transition effects include not only fades and dissolves, but also ``fly-in'' effects in which one image moves in and opens up on top of the old image.
On Friday in class, work on writing Python function definitions, using this worksheet as a guide. For reference, here is a Glossary of Python Functions, a guide to many of the functions available in Python, and in particular for PixelMath with Python.
Week 7 Begin projects: For Wednesday, May 9, come up with at least one idea for a possible project. Decide whether you would prefer to work by yourself or in a group. Friday, May 11. Make a specific project proposal.
Week 8 Projects: Initial Research. For Friday, May 18, be prepared to describe, in class, some initial research into your project topic. The research can consist either of an experiment using PixelMath or some online or library research on your topic. Be ready to give a 5-minute presentation, with either a demo or two or three screens worth of visual material (such as Powerpoint slides, textual pages, or images). Any text you show should be your own writing (not just a web page you found online), perhaps summarizing the key thing you have learned in this initial research.
Week 9 Projects: Progress. Give a short progress report on Thursday, May 24.
Week 10 Projects: Demonstrations. Friday, June 1 is the last day of classes and it's our projects demonstration day. Be prepared to show your project to the rest of the class that day. Reports on the projects are due the following Monday (June 4) at 5:00 PM. They can be turned in electronically using Catalyst E-Submit. The URL for turning them in will be posted here by about June 1.
Week 11 Project Reports: Reports on the projects are due the Monday, June 4 at 5:00 PM. They can be turned in electronically using Catalyst E-Submit. Here is the URL for turning them in. Your project files such as Python programs, Formula Pages, or images should be uploaded to INFACT and made accessible to all. Identify your main Python project file with a name such as ProjectPhotomosaic.py. Final Exam: The final will be held on Tuesday, June 5, from 2:30-4:20, in Sieg 232 (the lab where we normally meet). The format of the exam will be mixed: Part 1 will be multiple-choice, using pencils and paper "scantron" standard answer forms. Bring your own answer form -- you can purchase one for about 0.50 at the HUB branch of the bookstore. Part 2 will a mix of written answers and use of PixelMath. The coverage will be "cumulative" so that material from the midterm as well as material taught since the midterm will be on the exam.