Question: please answer in java and add comments as well. please answer as soon as possible. thank you. Question 2: Image Quantization Use a one-dimensional array

 please answer in java and add comments as well. please answer

as soon as possible. thank you. Question 2: Image Quantization Use a

please answer in java and add comments as well. please answer as soon as possible. thank you.

Question 2: Image Quantization Use a one-dimensional array to solve the following problem. You want to eventually perform some basic compression on an image. Assume that you will only be operating on a single row of the image (10 pixel values as shown in the sample outputs), and that pixel colors are represented as simple numbers in the array. You are required to quantize the values of the pixels in the row. In other words, any pixel values appearing in a range will assume a value in that range as indicated below. This creates redundancy that can lead to better compression. Overwrite the original values in the array as follows: Pixel value 0 to 20 21 to 40 41 to 60 61 to 80 81 to 100 101 to 120 121 to 140 141 to 160 161 to 180 More than 180 Quantized value 10 30 50 70 90 110 130 150 170 190 In your output you must print the array with the new, quantized values. Sample Output could be as follows: Sample 1: Please input pixel values : pixel 1 : 17 pixel 2 : 32 pixel 3 : 47 pixel 4 : 78 pixel 5 : 93 pixel 6 : 112 pixel 7 : 134 pixel 8 : 154 pixel 9 : 177 pixel 10 : 215 Quantized pixel values : 10 30 50 70 90 110 130 150 170 190 Sample 2: . Please input pixel values : pixel 1 : 34 pixel 2 26 pixel 3 : 89 pixel 4 : 90 pixel 5 : 123 pixel 6 : 453 pixel 7 : 88 pixel 8 : 59 pixel 9 : 179 pixel 10 : 15 Quantized pixel values : 30 30 90 90 130 190 90 50 170 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!