JMU
logoPerspecTV.png
Programming Assignment 6


1 Overview: PerspecTV had a contract with another university in Virginia to develop Markit, an application that allows them to add advertisments to virtual billboards during television broadcasts. Unfortunately, the application that was delivered to them was not tested exhaustively and, it turns out, exhibits several incorrect behaviors. Rather than fix the faults/defects, they have asked you to develop a new version of the problematic classes.

To avoid having to work with a live video feed, they have set things up so that you can work with an individual frame/image.

2 Definitions:

For the purposes of this application, an image is a rectangular two-dimensional array of colored dots (called pixels).

A pixel is a picture element in an image (i.e., an individual colored dot in an image.) For the purposes of this application, a pixel is a Color java.awt.Color object.

3 Existing (Working) Components: Several classes have alread been developed:

ImageStorage ( Byte Code ) (Documentation)
Camera ( Byte Code ) (Documentation)

Note that, since these classes were designed to be used with other applications, they may have functionality that you do not need.

In addition, the Markit class has the main() method for the application. You must not modify it.

Markit ( Source Code )

The execution of Markit is controlled with command line parameters that contain: the name of the file containing the frame/image and the names of the files containing the advertisements.

4 New Components: You must develop the following classes:

ImageManipulator ( Design )
SizeMismatchException ( Design )
BillboardMarker ( Design )

5 Testing:


5.1 Comparing Two Images
Since a 500x500 image contains 250,000 pixels, it is difficult to compare images "by hand". Hence, it is a good idea to write a small application named ImageDiff that compares two images pixel by pixel.

Since this is a fairly easy task, it is probably also a good idea to write this application before you start working on the BillboardMarker class. All you need to do is read in the two images (using the ImageStorage class) and loop over all of the pixels, comparing the corresponding pixels in the two images using the equals method in the Color class. Note: You may want to check the size of the two images (to make sure they are the same size) before you start looping.


5.2 Sample Images
Given the following sample images:

the following execution of the application:

      java Markit field.png wilson.png madison.png
      

must generate the following result:

Going Further


Copyright 2011