Question: The purpose of this assignment is to explore an application of selection. The goal is to un-clutter a set of images. The Birds directory on

The purpose of this assignment is to explore an application of selection. The goal is to \un-clutter" a set of images. The Birds directory on moodle contains a set of seventeen les, birds1.ppm through birds17.ppm, storing images in the PPM (Portable Pixel Map) format. The background is similar for each image, but each has some clutter (attacking birds). The directory also contains Blur.java, which has the boilerplate code to open and read in the les, and also write an output le (it just averages the pixel values over the images). You need to write a program (call it Clear.java) that produces an image le with the clutter removed. The images are sampled from a scene in the Alfred Hitchcock move \The Birds"; you can see the clip at https://www.youtube.com/watch?v=hplpQt424Ls. Promise that you won't use the image les for commercial entertainment purposes. The PPM les are plain text les with the following format. The rst line gives the image type, which is always \P3" for this exercise. The next line has two integers giving the number of columns and rows of the image. The next line has an integer giving the maximum level for any color. Then the rest of the le is a sequence of integers, three for each pixel, giving the red, green, and blue intensities. For example, consider the following image le: P3 3 4 255 255 0 0 0 255 0 0 0 255 0 0 0 255 255 255 120 120 120 255 255 0 255 0 255 0 255 255 100 100 100 200 200 200 0 100 0 The rst three lines are the header, with the rst line indicating that this is a P3 (plain) image. The next line tells us that this image has 3 columns and 4 rows of pixels. The next line gives the maximum intensity level of 255; all subsequent numbers in the le are between and 0 and the maximum 255. The following lines give the red, green, blue values for each pixel; the rst pixel has intensities 255 (red), 0 (green) and 0 (blue), so the top left pixel is red. The next pixel is green and the last pixel on the rst row is blue. The rst pixel on the second row is black (all three intensities equal to zero). On the Linux machines in the OSL lab, you can display a ppm image by clicking on it. On a Windows machine, you can display PPM images using, for example, the LibreOce Draw program or the ppmReader.html le in the Birds directory (open it with the Chrome browser). Be prepared to demonstrate your program during our next class. Your program should produce an image that shows what the view from the car would be if there were no birds.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!