Lectures/Notes
|
Version
2 - 9/27/2005 - A few hints are given, as well as some
ideas as to what the expectations are for parts 4 and 5.
Version 1 - 9/26/2005 - There are some parts that aren't filled in yet, but these shouldn't prevent you from getting started. Project 1 : Image ManipulationsDue Tuesday, October 11th 2005, 9:30am The purpose of this project is to have you implement some image manipulations. This will allow you to demonstrate that you understand image manipulation, and an opportunity to experience some of the pragmatic issues in doing image manipulation. This project consists of several independent pieces. You can think of it as five separate projects. You can write five separate programs. However, since these five parts all have lots in common, you are probably better off thinking about them together so you can share code between them. You could write one program that has some interface for doing all of the options.
(in case you're wondering, this is similar to last year's except we split resize into two separate operations to simplify grading). Late Bonus: For all Parts:Each of these operations should read in a Targa file and write back another Targa file. You may prompt the user (for example, using an FlTk file dialog box), or you may take the file names as command line arguments. Remember, that we define a Targa file to be the images that can read and written with the Libtarga library, so we recommend that you use that. Only the last part (interactive photo fix) requires a GUI. Note that this part of your assignment will probably fulfill the requirements for Programming Assignment 3, so when we grade your project we will check for that. If you choose to do the Interactive Photo Fix in a way that does not meet the Programming Assignment 3 requirements, you'll need to show off something else that does. We do not care what the user interface is for performing the operations. You might have 6 different command line programs, or 1 program with a GUI, or something in between. You must document your program/programs well enough that we can use it if we need to. Most importantly, you must be able to use your program. Grading Difficulty OptionsFor several of the parts of this project, you will have options as to the "difficulty level" of what you try to do. For example there might be an "easy" option and a "difficult option." Each option will be assigned a letter grade that is the highest grade you can get for taking this option. For example, if you take the "B" option on some part and do it really well, you'll get a B for that part. If you take the "A" option and your program doesn't get a correct answer, you might get a "C". You must tell us which option you chose to do before we do the grading (you must specify it in your README file). The grading standards are designed such that if you have a correct solution to a lower difficulty option and hand it in as a partial solution to a higher option, you will get a lower grade. You may choose a different option for each of the parts of the assignment. For some of the parts of this project, there are "Bonus" or "Extra Credit" options. Remember, that it is course policy that you cannot use extra credit to raise your grade. If you choose to do extra credit, you must also do the normal graded part. GradingEach of the five parts of the assignment will be graded. Your total grade will be the average of them (all weighted equally). You will be evaluated on:
Note: we will not evaluate the efficiency of your program (within reason). Concentrate on writing programs that get correct answers and are clean and readable code. If your program takes more than 10-20 seconds to process a 600x400 image, then maybe there's something wrong - but don't worry about trying to get into a race with Photoshop. More specific information on grading will be added later. Demonstrations:The main testing of your program will happen at a scheduled demonstration in B240. You will compile and run your program for us - we'll bring the test data. The Five Image Processing Operations:1. Resize: ReduceYour program must take a TGA image and produce a smaller version of it. The hints might help you! There are 4 difficulty options:
Written Questions: (for B and A options only):If you did proper sampling (B1 or A) -
If you did a variable reconstruction filter (B2 or A) -
2: Resize: EnlargeThis is similar to reduce, except that you should make the image bigger. There are Difficulty Options:
Written QuestionsIf you did "B" or "A": Describe the difference between the different kernels that you implemented in terms of how the images appear. On what images can you see a difference? Which kernels look better for which images? 3: Convert to Black and WhiteYour program must be able to convert a color image to a black and white one. That is, the result of this command must be an image where each pixel is either black or white (0,0,0 or 255,255,255). In making the conversion, your program should account for the perceptual sensitivities of the human eye. (e.g. we are more sensitive to green than to red, and more sensitive to red than to blue). Because our eyes are more sensitive to green, an equally bright green, blue, and red will not appear equally bright. This means that if you are converting between color and grayscale, the color red (255,0,0) should not turn into the same brightness as the color green (0,255,0). The exact ratios vary. One simple one is to say that green is twice as sensitive as red is twice as sensitive as blue, which gives the rations for R,G,B as 2/7, 4/7, 1/7, or .28, .57, .14. I have also seen systems that use r = 0.212671, g = 0.715160, b = 0.072169.The closest thing to an "official" standard is what is used in NTSC (the North American video standard) to compute brightness from colors. That's: Y = 0.30R + 0.59G + 0.11B. There are many possible quantization algorithms. Several were discussed in class, or in the readings. You should pick the best one that you can implement. However, it is better to have a correctly working simple threshold than an incorrectly working error diffusion method. The basic "signs of life" required for this part is that your program successfully creates a valid black and white image, and that the image resembles the input. Your program's ability to capture gradations in tone will get you a better grade. Difficulty Options:
Written Questions:
4: Impressionist PaintingYour program must take a color image and produce a new color image that is a "painted" version of the original. The basic idea is that you sample the original image and for each sample you place a "brush stroke" in the destination image. You need to randomize the order of the strokes a little. This is a case where undersampling/aliasing actually creates some nice effects Here's an example (click on an image to get the bigger versions):
One possibility is to have the user specify where the brush strokes go (have them click on the image and brush strokes appear there). The original version of painting did it this way. You can see a Java implementation of it here. Paul Haeberli, the inventor of the technique, is a UW alumn! Implementing the interactive version is fun, and could probably serve as your solution to Programming Assignment 3. However, you must also have a "batch mode" version that processes a whole picture without any user intervention. We've seen some pretty creative solutions to this assignment in past years. Here are some ideas:
Making good paintings from images is a hard problem. There is actually a lot of research out there. Haeberli's original paper is easy (and fun) to read. Here is another old (but good) source of lots of ideas. The version of this project that was assigned at U. Texas has even more ideas. (note: the Texas project has students use the OpenGL graphics library to render the brush strokes. You must render the brush strokes yourself (actually writing the pixels into the image). A note on expectations: Difficulty Options:
Written Question:Describe the algorithm that you implemented. One specific detail that we will want to know: how do you choose where to sample/place brush strokes. If you do anything fancy, be sure to describe it. Hand in Note: please turn in 1-3 small images produced with your painting algorithm that shows off how well it works. 5: Red-Eye ReductionWhen you take a picture of a person with a flash that is too close to the lens, the light bounces off their retina (which is red from all the blood vessels) and back into the camera, causing their eyes to glow red. There are various ways to avoid this, such as moving the flash away from the lens (which is hard on a small camera) or making a few pre-flashes to cause the person's pupils to close so no light gets inside to the retina. (this latter effect doesn't work with babies, who don't have that reflex, or drunk or stoned people, who lose that reflex). (Note: we will soon provide you with lots of sample images, as well as the "ZoomerWindow" example program. What makes this program interesting is that it lets you zoom in on a part of the image and paint on it accurately - very useful when you're trying to paint on something small like the eyes). Needless to say, sometime, you get pictures where the person's eyes are glowing red. For this part of the project, you must make a tool that fixes the problem. There are two parts to fixing red-eye:
Each part is surprisingly hard. The reason we're giving you this project is we want you to experiment to realize how hard it is to find colors and things like that. A simple solution would require the user to specify each pixel by painting (now you know why I gave you the ZoomerWindow example), and paint it black. Not only is this a lot of work for the user, it also looks bad. The ultimate solution would automatically find the red eyes and change the pixels in a realistic manner so you couldn't tell the image had been manipulated. This is really hard. Even commercial software doesn't do it perfectly. Realistic good solutions require the user to point to where the eye is, have the system figure out the problematic pixels near where the user points, and does some set of color corrections to get the red out without making the eyes look "wrong" (hint: black eyes look almost as weird as red eyes). Your solution will be evaluated by how much effort it is for the user, and how good the eyes look on some test cases. So, for example:
Note: we will test your program by having you give a demo of it. We will provide some test images for you to practice on - check the class announcements web page for details. A note on expectations: The difficulty levels:
Written QuestionDescribe your algorithm. Handing in your assignmentYour assignment will be handed in by placing files into your handin directory (P:/course/cs559-gleicher/handin/LOGIN/p1). The "effective date" of your handin will the be timestamp of the last file put into this directory. Your handin must include:
You should not include any of the intermediate files or an executable. Note: when we test your program, we will copy your handin directory to the local disk of a STORM machine, load the solution file into Visual Studio, and hit compile. You should check to make sure this will work. Some Implementation HintsSome hints to make your life easier:
|