SobelX (edge-detection along x-direction):
1 2 1 0 0 0 -1 -2 -1
SobelY (edge-detection along y-direction):
-1 0 1 -2 0 2 -1 0 1
Note that the original Sobel filter kernels are only sensitive to gradients in one direction (low-to-high, but not high-to-low). The second filter graph shown in the applet demonstrates how to construct the 'full' edge representation of the input image. This is done by combining (here via add operations) all four possible directions. Naturally, one could use additional filters with inverted kernels, but the filter graph above does this by mirroring the input image, applying a Sobel filter, and mirroring the output image back.
Run the applet | Run the editor (via Webstart)