Reading phrase and making codeFor this program you are provided several source files. (The files can be found in the Resources Block on WAMAP) The first step is to create a Project in Eclipse and import those source files. When you get the source compiled and the application running it should look like the provided “runnable .jar file”. You run the runnable .jar file by double-clicking on the java icon. What to turn in: After you have added your filters you will have to modify some of the files you started with and also create some new .java files. In this assignment you will practice doing the following: Digital image processing has completely revolutionized the way images are created and used in news photography publishing commercial art marketing and even in some of the fine arts. Adobe’s Photoshop program has become so ubiquitous that it has even become a verb – “this picture is a mess I need to Photoshop it”. In this assignment you’ll implement some of the core image transformation algorithms used by image processing programs like Photoshop. Image Representation A digital image is a rectangular array of pixel objects. Each pixel contains three integer values that range from 0 to 255 one integer each for the red green and blue components of the pixel in that order. The larger a number the brighter that color appears in the pixel. So a pixel with values (000) is black (255255255) is white (25500) is pure red (00255) is pure blue and so forth. We can represent a Pixel as a simple Java object containing three int instance variables and for convenience a constructor to create a new pixel given its rgb component values. Well treat these as simple data objects and allow direct access to their fields. /** Representation of one pixel */public class Pixel {public int red; // rgb values in the range 0 to 255public int green;public int blue;/** Construct a new pixel with specified rgb values */public Pixel(int r int g int b) {this.red = r;this.green = g;this.blue = b;}}An image is represented by an instance of class PixelImage. This class contains the methods getData() and setData() to retrieve 2-dimensional arrays of Pixel objects representing the pixels of the image. You can also use the methods getHeight() and getWidth() to get the height and width of the image. The Application Francois has implemented a PhotoShop-like Java application called SnapShop. The application knows how to load image files and provides all the user interface objects youll need to apply your filters to the image. You will need not implement anything in the SnapShop class but create a few new classes. The file loader of the SnapShop class expects filenames to be fully specified that is you must say something like c:directoryimage.jpg. Normal (forward) slashes also work: c:/directory/image.jpg. To save you some work weve provided a shortcut so you dont need to always retype the file name; details below. SnapShop has a main method. Once you have the files imported into the project and compiled selecting ‘run’ in Eclipse will run the SnapShop application. Also provided is an interface class ‘Filter’. An interface simply specifies the methods another class must implement and cannot be used to make objects itself. You will be writing classes that implement this Filter interface one for each transformation you write. Each class implementing the Filter interface must have a method called filter() which takes a PixelImage as an argument. The method then applies a transformation to the data in the image. As an example we have included the FlipHorizontalFilter class which flips an image horizontally. You will need some way to tell our SnapShop class which filters you have implemented. So weve provided a class called SnapShopConfiguration with a single method configure(). In this method you can call methods for the SnapShop object. The two methods youll be interested in are addFilter() which creates a button in the application to apply your filter and setDefaultFilename() which lets you specify a default path or filename for the file loader to aid you in testing. For each filter that you create there should be a call to addFilter() in the configure() method. (A note on setDefaultFilename(). Windows path names have backslashes () in them. To specify this in a string in a Java source program you need to put two backslashes. For example the Java string for c:directoryimage.jpg would be “c:\directory\image.jpg”.)Here are the files you need to download to get started: SnapShop.java SnapShopConfiguration.java Pixel.java PixelImage.java Filter.java FlipHorizontalFilter.java. You should use billg.jpg to test your code as that is the input used to create the reference images. If you use other images as test images be sure that they arent too much bigger than billg.jpg. Your program will take a long time to process a large image and the window may not wind up looking right. Simple Transformations There are two kinds of transformations that you are required to implement. The simple transformations can be implemented by replacing each Pixel in the existing image with the updated one. The more complex 3×3 transformations require creating a new array of Pixels with the transformed image then updating the image instance variable to refer to the new array once it is completely initialized. The first three transformations you should implement flip the image horizontally and vertically and transform the image into a photographic negative of itself (that is you should create a flipHorizontalFilter flipVerticalFilter and NegativeFilter class). We have implemented flipHorizontalFilter for you. The first two require a simple rearrangement of the pixels that reverses the order of rows or columns in the image. The negate transformation is done by replacing each Pixel in the image with a new Pixel whose rgb values are calculated by subtracting the original rgb values from 255. These subtractions are done individually for each of the red green and blue colors. These transformations can be performed by modifying the image array of Pixels directly. You should do these first to get a better idea of how the image is represented and what happens when you modify the Pixels. You should make every effort to get this far before the end of week 9. That will ensure that you’ve made good progress on this assignment or at least know what you need to clear up in discussions during lecture. Notes: 3×3 Transformations Once you’ve got the simple transformations working you should implement this next set which includes Gaussian blur Laplacian Unsharp Masking and Edgy. All of these transformations are based on the following idea: each pixel in the transformed image is calculated from the values of the original pixel and its immediate neighbors i.e. the 3×3 array of pixels centered on the old pixel whose new value we are trying to calculate. The new rgb values can be obtained by calculating a weighted average; the median minimum or maximum; or something else. As with the negate transformation the calculations are carried out independently for each color i.e. the new red value for a pixel is obtained from the old red values and similarly for green and blue. The four transformations you should implement all compute the new pixel values as a weighted average of the old ones. The only difference between them is the actual weights that are used. You should be able to add a single method inside class PixelImage to compute a new image using weighted averages and call it from the methods for the specific transformations with appropriate weights as parameters. You should not need to repeat the code for calculating weighted averages four times once in each transformation. The method you add to PixelImage to do the actual calculations can of course call additional new methods if it makes sense to break the calculation into smaller pieces. Here are the weights for the 3×3 transformations you should implement. Gaussian 1 2 12 4 21 2 1 After computing the weighted sum the result must be divided by 16 to scale the numbers back down to the range 0 to 255. The effect is to blur the image. Laplacian -1 -1 -1-1 8 -1-1 -1 -1 The neighboring pixel values are subtracted from 8 times the center one so no scaling is needed. However you do need to check that the weighted average is between 0 and 255. If it is less than 0 replace the calculated value with 0 (i.e. the new value is the maximum of 0 and the calculated value). If it is greater than 255 then replace the calculated value with 255. This transformation detects and highlights edges. Unsharp masking -1 -2 -1-2 28 -2-1 -2 -1 This transformation is created by multiplying the center pixel and subtracting the Gaussian weighted average. The result must be divided by 16 to scale it back down to the range 0 to 255. As with the Laplacian transformation check for negative weighted averages or weighted averages greater than 255 (and do the same thing as in the Laplacian case to fix it). Edgy -1 -1 -1-1 9 -1-1 -1 -1 This adds the Laplacian weighted average to the original pixel which sharpens the edges in the image. It does not need scaling but you need to watch for weighted averages less than 0 or greater than 255. Notes: Further explorations (for some amount of extra credit) Once you have the basic assignment working turn it in so you’ve got something submitted. Then feel free to experiment with additional transformations. Besides varying the weights you can try replacing each pixel by the minimum or maximum value in the neighborhood or the median. Try weights that are not symmetric. Try using a larger neighborhood like 5×5. Or look on the web for additional things you can do with the images. Some small amount of extra credit (up to 50 points) may be awarded for particularly imaginative work. Report Write a short report (as a comment) at the beginning of the SnapShopConfiguration file. Describe: (-10 points if you dont provide a report)

Order a unique copy of this paper
(550 words)

Approximate price: $22

Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

We value our customers and so we ensure that what we do is 100% original..
With us you are guaranteed of quality work done by our qualified experts.Your information and everything that you do with us is kept completely confidential.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

The Product ordered is guaranteed to be original. Orders are checked by the most advanced anti-plagiarism software in the market to assure that the Product is 100% original. The Company has a zero tolerance policy for plagiarism.

Read more

Free-revision policy

The Free Revision policy is a courtesy service that the Company provides to help ensure Customer’s total satisfaction with the completed Order. To receive free revision the Company requires that the Customer provide the request within fourteen (14) days from the first completion date and within a period of thirty (30) days for dissertations.

Read more

Privacy policy

The Company is committed to protect the privacy of the Customer and it will never resell or share any of Customer’s personal information, including credit card data, with any third party. All the online transactions are processed through the secure and reliable online payment systems.

Read more

Fair-cooperation guarantee

By placing an order with us, you agree to the service we provide. We will endear to do all that it takes to deliver a comprehensive paper as per your requirements. We also count on your cooperation to ensure that we deliver on this mandate.

Read more

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency

Order your paper today and save 30% with the discount code HAPPY

X
error: Content is protected !!
Open chat
1
You can contact our live agent via WhatsApp! Via + 1 323 412 5597

Feel free to ask questions, clarifications, or discounts available when placing an order.