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.
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
object.
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.
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.
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.
the following execution of the application:
java Markit field.png wilson.png madison.png
must generate the following result:
Copyright 2011