import java.awt.*; import java.awt.image.*; import java.applet.*; import java.net.*; import java.io.*; import java.lang.Math; import java.util.*; import java.awt.event.*; import javax.swing.*; import javax.swing.JApplet; import javax.imageio.*; import javax.swing.event.*; public class sobel { int[] input; int[] output; float[] template={-1,0,1,-2,0,2,-1,0,1};; int progress; int templateSize=3; int width; int height; double[] direction; public void sobel() { progress=0; } public void init(int[] original, int widthIn, int heightIn) { width=widthIn; height=heightIn; input = new int[width*height]; output = new int[width*height]; direction = new double[width*height]; input=original; } public int[] process() { float[] GY = new float[width*height]; float[] GX = new float[width*height]; int[] total = new int[width*height]; progress=0; int sum=0; int max=0; for(int x=(templateSize-1)/2; x