CS376A Digital Image Processing Skidmore College Assignment 02 Due Wednesday 03/08/2023 via email. Attach a zip file (please do not create a rar file) with all the code and images. ------------------------------------------------ Get all the .java files posted next to 02/20/2023 on our class notes page. Submit to me 4 to 8 original color images and at least 12 output files, At least 6 variations on the color matching for the two different color matching methods I ask you to do below. Naming: if your originals are name pic1.jpg, pic2.jpg, pic3.jpg, pic4.jpg, pic5.jpg, pic6.jpg your output images should be named like so: matched-pic1-with-pic2-as-ref-rgb.jpg matched-pic4-with-pic2-as-ref-rgb.jpg matched-pic6-with-pic2-as-ref-rgb.jpg matched-pic2-with-pic6-as-ref-rgb.jpg matched-pic3-with-pic6-as-ref-rgb.jpg matched-pic5-with-pic6-as-ref-rgb.jpg matched-pic1-with-pic2-as-ref-ycbcr.jpg matched-pic4-with-pic2-as-ref-ycbcr.jpg matched-pic6-with-pic2-as-ref-ycbcr.jpg matched-pic2-with-pic6-as-ref-ycbcr.jpg matched-pic3-with-pic6-as-ref-ycbcr.jpg matched-pic5-with-pic6-as-ref-ycbcr.jpg One thing you are required to do: if you submit to me something like: matched-pic1-with-pic2-as-ref-rgb.jpg I'd also like you to submit the same pair with YCbCr which is named: matched-pic1-with-pic2-as-ref-ycbcr.jpg ------------------------------------------------ 0. After you write the code for this assignment, I'd like you to experiment with many images, maybe a mix of ones you took yourself and ones from elsewhere. And the ones you choose to submit should be ones you'd like to show because they are interesting in some way. For example, a bunch of the ones I ran in class with the Magritte image as the reference I didn't think looked that great, so I probably wouldn't choose those to send. Say for 2 images, you are not required to send me the results of both the using first image as ref and second image as input and vice versa. Feel free to only submit the one that you think "works" best for whatever reason. 1. You job is to implement Histogram Matching (aka Histogram Specification) on color images. Create a class named HistogramMatching that has a main method. Look at the class notes from 02/22/2023 specifically the slide that starts with the phrase "Histogram matching can be done in the following way". Do Histogram Matching on the Red channel, Green channel, and Blue channel, all separately. Implement this as a method in HistogramMatching.java 2. Create another method in HistogramMatching.java that does histogram matching on the Y channel, Cb channel, and Cr channel, all separately. Note: The Cb and Cr values are stored as doubles, you can leave them stored as doubles and just do (int)Math.round(____) to get a rounded number in the range 0..255 so your histogram of the channels Y, Cb, and Cr are all 256 discrete bins. Some ideas of methods you might need to write: You will need to add get and set methods each for Y, Cb, Cr in YCbCrPixel class. Might also need a setPixelYCbCr method in RGBImage class. When you create the output image of type RGBImage you'll need call a constructor that generates all non-null RGBPixels and also then creates the YCbCrpic 2d array and makes them all non-null YCbCrPixels if you expect to be able to call a setPixelYCbCr method to simply set a pixel. -------------------------------------------------------------------- You may use the following method to extract the image name (excluding path and . extension) so you can build your output file name. // Helper method to allow you to generate the output image names public static String getNameWithoutPathAndExtension(String fileAndPathName) { int dotIdx = fileAndPathName.lastIndexOf("."); // uncomment one of the following int slashIdx lines: // this is good for linux or mac //int slashIdx = fileAndPathName.lastIndexOf("/"); // this is good for Windows I think but your file name with // path would need to be like: C:\\My Documents\\image.jpg //int slashIdx = fileAndPathName.lastIndexOf("\\"); String prefix = fileAndPathName.substring(slashIdx+1, dotIdx); return prefix; }