import java.awt.*; import java.awt.image.*; import java.applet.*; import java.net.*; import java.io.*; import java.lang.Math; import java.util.*; // additional stuff for swing import java.awt.event.*; import javax.swing.*; import javax.swing.JApplet; import javax.imageio.*; import java.util.Arrays; public class averageFilter { int[] input; int[] output; float[] template; int progress; int templateSize; int width; int height; public void averageFilter() { progress=0; } public void init(int[] original, int widthIn, int heightIn, int templatesizein) { templateSize=templatesizein; width=widthIn; height=heightIn; input = new int[width*height]; output = new int[width*height]; template = new float[templateSize*templateSize]; input=original; } public int[] process() { float sum; progress=0; int val = 0; // value of all the pixels in the kernel area int count; int outputsmaller[] = new int[(width-(templateSize-1))*(height-(templateSize-1))]; for(int x=(templateSize-1)/2; x