Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help with IMAGE STACKING. There is a lot of code that we do not make changes to. Including so you can see what is
Need help with IMAGE STACKING. There is a lot of code that we do not make changes to. Including so you can see what is happening with code.
All code is supposed to be written in the first method and no where else. Please let me know if additional information is needed
package imagestacker; import java.awt. Color; import java.awt. GridBagConstraints; import java.awt. GridBagLayout; import java.awt. event.ActionEvent; import java.awt.event.Actionlistener; import java.awt.image.BufferedImage; import java.io. File; import java.io. FilenameFilter; import java.io. IoException; import javax. imageio. ImageIo; import javax. Swing. JButton; import javax. Swing. JFileChooser; import javax. Swing. JFrame; import javax. Swing. JLabel; import javax. Swing. JoptionPane; import javax. Swing. JPanel; import javax. Swing. JTextField; 3 Open the ImageStacker.java file in NetBeans and find the averagePixelValues method (the first method in the class). All the code you write will be in this method. Do not change any of the other methods in this class. This method takes in a two-dimensional array of pixel values. You'll notice that each of the image sets provided contain ten images. This two-dimensional array is an array that contains the array of pixel values for each of the ten images. The pixel values for the first image are in images[0], the pixel values for the second image are in images[1], and so on. A new array has been set up for you. This is the array where you will store the new pixel values that you calculate. Currently, each cell in the array contains 0 , which is why the picture generated is black. This method contains a "for loop" that iterates through each cell of the new array. Your job is to provide the code inside the loop to calculate the new value for each pixel. I have left comments there for you to follow. Open the ImageStacker.java file in NetBeans and find the averagePixelValues method (the first method in the class). All the code you write will be in this method. Do not change any of the other methods in this class. This method takes in a two-dimensional array of pixel values. You'll notice that each of the image sets provided contain ten images. This two-dimensional array is an array that contains the array of pixel values for each of the ten images. The pixel values for the first image are in images[0], the pixel values for the second image are in images[1], and so on. A new array has been set up for you. This is the array where you will store the new pixel values that you calculate. Currently, each cell in the array contains 0 , which is why the picture generated is black. This method contains a "for loop" that iterates through each cell of the new array. Your job is to provide the code inside the loop to calculate the new value for each pixel. I have left comments there for you to follow. Submitting Zip up your NetBeans project folder and submit it in Brightspace
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started