Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 files, 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 files, and also write an output file (it just averages the pixel values over the images). You need to write a program (call it Clear.java) that produces an image file 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 wont use the image files for commercial entertainment purposes. The PPM files are plain text files with the following format. The first 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 file is a sequence of integers, three for each pixel, giving the red, green, and blue intensities. For example, consider the following image file: 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 first three lines are the header, with the first 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 file are between 0 and the maximum 255. The following lines give the red, green, blue values for each pixel; the first 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 first row is blue. The first 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 LibreOffice Draw program or the ppmReader.html file in the Birds directory (open it with the Chrome browser). 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

Define the term "Leasing"

Answered: 1 week ago

Question

What do you mean by Dividend ?

Answered: 1 week ago

Question

What is database?

Answered: 1 week ago

Question

What are Mergers ?

Answered: 1 week ago

Question

LO6 List the components of job descriptions.

Answered: 1 week ago

Question

LO3 Define job design and identify common approaches to job design.

Answered: 1 week ago