Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write programs in your language of choice (preferably C++ or Java) to perform th

ID: 3689456 • Letter: W

Question

Write programs in your language of choice (preferably C++ or Java) to perform the following operations: Show all the images in the original spatial and gray-scale resolution when you compare it to the transformed image with modified spatial or gray-scale resolution. 1. Vary the spatial resolution of your image from the given scale to 640x480 and down to 80x60 and then zoom it again to see the loss of detail. Use the replication method, nearest neighbor method and bilinear interpolation method for zooming it back the desired resolution. 2. Vary the gray level resolution of your image from 8-bit to a 1-bit image in steps of 1-bits. 3. Provide a function that allows for both log and power transformation of the gray scale values of your image. Allow the user to set the value of constants like c and . 4. Write functions to perform histogram equalization (HE) on any image. The program should provide the user with a choice of doing global or local histogram equalization. In case of local histogram equalization, ask the user for the resolution of the square mask to be used. 5. Write a function to provide histogram matching on your image using another image whose histogram you will use to match with your image. Ask the user to select another desired image (doesn’t have to be displayed by your GUI) and then show the histogram-matched image.

Explanation / Answer

import java.io.File; import java.io.IOException; import java.awt.image.BufferedImage; import javax.imageio.ImageIO; public class Grayscale{ public static void main(String args[])throws IOException{ BufferedImage img = null; File f = null; //read image try{ f = new File("D:\Image\Taj.jpg"); img = ImageIO.read(f); }catch(IOException e){ System.out.println(e); } //get image width and height int width = img.getWidth(); int height = img.getHeight(); //convert to grayscale for(int y = 0; y 24)&0xff; int r = (p>>16)&0xff; int g = (p>>8)&0xff; int b = p&0xff; //calculate average int avg = (r+g+b)/3; //replace RGB value with avg p = (a
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote