编程代写 – Assignment代写- CPT105 CW3 代写
编程代写

编程代写 – Assignment代写- CPT105 CW3 代写

CPT105 CW3 2020 – Resit Assignment

 

 

编程代写 This assignment has three parts, Parts A, B, C. You will use the existing Color and Picture classes that you have used in your lab classes and ···

 

编程代写

This assignment has three parts, Parts A, B, C. You will use the existing Color and Picture classes that you have used in your lab classes and create methods to modify images. Part A will be due on Wednesday July 28 (28/07/2021) at 18:00, and Parts B and C will be due on Monday August 02 (02/08/2021) at 18:00.Due dates: Part A: Wednesday July 28 2021, Parts B and C: Monday August 2 2021 – 100% of final mark

We will be using two classes a lot in this project: Color and Picture. The Color class provides us an encapsulation for the RGB color component values and is located in the java.awt package – you need to import it. The Picture class allows you to write Java programs that manipulate pictures and is provided in the cw3.zip file on Learning Mall.

To support you, we have provided a cw3resit.zip folder on Learning Mall. This contains some sample code, empty methods for you to work with, and a sample image.

All submission will be via Learning Mall as used throughout this semester, see end of each part for further instructions.

Part A  Image Modifications (45% of assignment), DUE Wednesday July 28 (28/07/2021) at 18:00

In Part A, you have to write a method to manipulate an input Picture object as described in the following section. You have to follow the description to produce the correct output. There are 4 tasks to complete, Task A1, A2, A3 are worth 10%, A4 is worth 15%. You should submit your individual methods on in the appropriate code runner section of Learning Mall. There are sample correct output images in the zip file that you can use to test your method, using the

Picture’s equals method.

In all these tasks, you will be marked based on the output images, and you have a sample project provided on Learning Mall to use.

Part A.1 Lean (10%)  编程代写

Write a method Picture lean (Picture picture) to lean a picture by rotating the picture 20 degrees counter clockwise. To rotate a picture by θ radians counterclockwise, copy the color of each pixel (cols, rows) in the source picture to a target pixel (colt, rowt) whose coordinates (in int) are given by the following formulas:

colt = (int) ( (cols – colc) × cos θ – (rows – rowc) × sin θ + colc ) rowt = (int) ( (cols – colc) × sin θ + (rows – rowc) × cos θ + rowc )

where colc and rowc are the coordinates (in double) of the center of the width-by- height picture, computed by:

colc = 0.5 × (width – 1) rowc = 0.5 × (height – 1)

Note that you should only copy the pixel if the target pixel is in bounds, so as not to change the dimension of the image. Use black for target pixels with no copied color.

For example, an original ship and a tilted ship is shown below. A fully working and perfect image will get full marks, with mark deductions for repeated attempts.

Part A.2 Sharpen (10%)  编程代写

Write a method sharpen (Picture picture) to add a sharpen style effect to a picture by applying the following kernel (see Appendix 1 for information on applying a ‘Kernel Filter’:

An original ship image and the sharpened ship are shown below, note the loss of smoothness in the images, and the extra details. A fully working and perfect image will get full marks, with deductions for repeated submissions. For more information about applying a Kernel Filter, please see the appendix at the end of this sheet.

Part A.3 Blur (10%)

Write a method Picture blur(Picture picture) to blur a picture by applying the following kernel (one-ninth in a 9-by-9 diagonal matrix). This means applying the diagonal matrix, and then dividing the result by 9:

Part A.4 Edge Detection (15%)  编程代写

Write a method Picture edge(Picture picture) to perform edge detection of a picture as follows. First convert the picture into a grayscale picture. You can achieve that by simply calling the static grayScale(picture) method, which is provided as part of the example code, and is similar to the method created in your lab classes.

Picture grayPic = CW3_Example.grayScale(picture);

Next, apply these two kernels to each grayscale component (you only need to do one computation since all three color components of a grayscale picture are the same) of a pixel, the following:

Submission

Submit your code for part A to Learning Mall in a similar manner to the weekly programming quizzes (CW1s). Further guidance is provided in your lab classes. Again, the priority is to ensure that your code produces an image, as credit will be given accordingly.

Part B  Creative Image Transforms (30% of assignment), Monday August 02 (02/08/2021) at 18:00

In Part B, you have more creativity to create methods to transform images. There are 2 tasks to complete, both are worth 15% of your grade. In both methods, you must draw the original image with a transformed image side by side, and the method must be general and applied to any picture. You should submit your individual methods on in the appropriate code runner section of Learning Mall.

In all these tasks, you will be marked based on the output images. You should therefore prioritise being able to display an image over a complex transform that does not work.

Part B.1 Positional Transform (15%)  编程代写

In Part A1, you applied a positional transform. Now, write a method positionalTransform, that will transform the pixel positions of the original picture and display the original and transformed images side by side in the same picture. You have a free choice of how you wish to do this. The original and transform must be drawn on the same image. More creativity will get extra marks! You should experiment and carry out independent research, and submit it to Learning Mall.

For example, for 50 marks, you can create a method that produce a mirror image, such as:

You will get more marks for more creative transformations. For 60+ marks, you can create a wave effect, for example:

Part B.2 Color Transform (15%)

Write a method colorTransform that will transform the Color of the pixel of the original picture. You have a free choice of how you wish to do this. The original and transform must be drawn on the same image. More creativity will get extra marks.

For example, for 50 marks, you can create a method that produces a negative picture effect, such as:

Submission  编程代写

Submit your code to Learning Mall in the section allocated to Part B. Further guidance is provided in your lab classes. The priority is to ensure that your code produces an image, as credit will be given accordingly.

You should also submit documentation for these questions, as will be discussed in Part C.

Part C  Documentation (25% of assignment), DUE Monday August 02 (02/08/2021) at 18:00

In Part C, you need to complete the design and documentation of the programs you wrote in the previous parts. This is worth 25% of your overall grade, and will be submitted on Learning Mall.

Class Diagram

You used the Picture class to create your objects. Draw a class diagram. You must use a drawing tool of your own, such as Powerpoint, Visio, or an equivalent. You must not use any autogeneration software.

Report

You must submit a written report. You must provide a description (100-150 words) for each of the methods you have created in Part B. In each description, you should describe the technical steps in your method, the effect you are trying to achieve, and how it is creative and meaningful (i.e. a useful effect). Your report should also contain 3 sample pictures (these must be new pictures, not the sample image given) to demonstrate your transforms.

Submission  编程代写

Two template files are given in Learning Mall:

  1. PartC_1, a .docx file, for your class diagram, report and sample output
  2. PartC_2, a .txt file, for your code

Follow the instructions found within the two template files.

Rename it according to the instruction, and submit the two files in the corresponding CW3 Part C_1 or C_2 dropbox on Learning Mall.

Notes

  • Allof the coding can and should be achieved using the Java resources covered in the lectures so far this semester.
  • Youwill need to do independent research to investigate possible transforms in section B
  • Yourcode must compile in learning  If it does not compile, it will get 0 marks.
  • Astarter set of classes is available on Learning Mall for you to use, as well as some images.
  • Thedesign should be your  Shared designs with friends will be considered plagiarism.

This assignment is individual work. Plagiarism (e.g. copying materials from other sources without proper acknowledgement) is a serious academic offence. Plagiarism and collusion will not be tolerated and will be dealt with in accordance with the University Code of Practice on Academic Integrity. Individual students may be invited to explain parts of their code in person, and if they fail to demonstrate an understanding of the code, no credit will be given for that part of the code.

Appendix 1: Kernel Filter  编程代写

A kernel filter modifies the pixels in a picture by replacing each pixel with a linear combination of its neighboring pixels and itself. The matrix that characterizes the linear combination is known as the kernel.

Specifically, to apply a kernel filter to a picture, perform the following operation for each RGB components of each pixel p separately:

  • Alignthe center of the kernel on pixel
  • Thenew component value of pixel p is obtained by multiplying each kernel element with the corresponding component value, and adding the results.

After that, combine the results to get the new color.

For example, to apply an emboss kernel filter (see Part A.2 above) to the middle Red component value of 50 of a pixel on some part of a picture:

we compute the new value to be

= (-2)10 + (-1)20 + (0)30 + (-1)40 + (1)50 + (1)40 + (0)10 + (1)20 + (2)30 = 90.

We then combine that with the similar computation on the Green and Blue components to obtain the new color of the corresponding pixel.

Note the following important information about the computation:

  • Periodic boundary conditions. When applying a kernel filter to a pixel near the boundary,some of its neighboring pixels may not  In such cases, assume the leftmost column wraps around to the rightmost column, and vice versa; and the top row wraps around to the bottom row, and vice versa. For example:

  • Rounding. When applying a kernel filter, the resulting RGB components may becomefractional if the kernel weights are  Round each RGB component to the nearest integer, with ties rounding up.
  • Clamping. When applying a kernel filter, the resulting RGB components may not remain between 0and  If an RGB component of a pixel is less than 0, set it to 0; if is greater than 255, set it to 255.

 

更多代写:CS网课代修  EAP代写代考 英国代写 ECO essay代写 管理学英国代写 潘恩学院代写

合作平台:天才代写 幽灵代  写手招聘  paper代写

发表回复