Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

=+What is your height and weight?

Answered: 1 week ago

Question

Describe Balor method and give the chemical reaction.

Answered: 1 week ago

Question

How to prepare washing soda from common salt?

Answered: 1 week ago