/** Runs Sobel operator over bordered image. * Image is 8x8 plus 1px border, total of 10x10. * @author Bob Futrelle * @version March 27 2004 v0.1 **/ public class Sobel { public Edgelet[][] run(double[][] image) { Edgelet[][] e = new Edgelet[10][10]; for(int i=1; i<9; i++) for(int j=1; j<9; j++) { e[i][j] = new Edgelet(); e[i][j].x = - image[i-1][j-1] - 2*image[i][j-1] - image[i+1][j-1] + image[i-1][j+1] + 2*image[i][j+1] + image[i+1][j+1]; e[i][j].y = - image[i-1][j-1] - 2*image[i-1][j] - image[i+1][j+1] + image[i+1][j-1] + 2*image[i+1][j] + image[i+1][j+1]; e[i][j].createMagnitude(); } return e; } // run() } // class Sobel