Question: Hello, I need help writing code in Java to test out the junit test in the photo. the Hint I was given was : This

Hello, I need help writing code in Java to test out the junit test in the photo.
the Hint I was given was :
This is a more challenging filter as you must consider a rectangular window that will move throughout the span of the image.
1.Take a 2x2 window (starting from the upper-left corner of the image) and sum all the red, green, and blue values separately for all the pixels in that window. In a 2-by-2 window, there will be a total of 4 pixels for which to sum the three separate channels.
2. Take the sum found for each channel of all the pixels in the window and divide them by 4.
3.Set the red, green, and blue values of the top-left-most pixel of the 2-by-2 window to be the value calculated from #2.
4.Perform this on the entire image moving the 2x2 window by one pixel each time from left-to-right and top-to-bottom where top-most will be row 0 and left-most is column 0.
Thank you
 Hello, I need help writing code in Java to test out

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!