Question: Need help JAVA problem Look at the following image which is 256x256x8. the 8 is color bit (grayscale): http://s000.tinyupload.com/index.php?file_id=94569703793462768168 Note: you can use this image

Need help JAVA problem

Look at the following image which is 256x256x8. the 8 is color bit (grayscale): http://s000.tinyupload.com/index.php?file_id=94569703793462768168

Note: you can use this image only or any 256x256 grayscale image in .dat or .pgm (not pgn) format

Generate an image with the following spatial resolutions:

i) 128 (256/2) using 2x2 matrix ii) 64, using 4x4 matrix iii) 32 using 8x8 matrix iv) 16 using 16x16 matrix. The resulting image should still be 256x256. ie the image will be pixelated

to do this, read every byte of image above into a two dimension array having same dimension as image. then by iterating into 2d array as the mask is applied (mask is through each grouping of values and average of each group is calculated).

ii) Then apply quantization to image. for image above, each pixel is 256 gray level = 8 bit. reduce this to 16 gray level (4 bit) , 2 bit and 1 bit.

Here, every byte of file is read into a two dimension array with same dimension as image file. we then iterate through 2d array dividing by a divisor to scale down bit size. this is run for each pixe3l in image. the result is then output to a pgm image file.

Let me know if you have any questions

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!