Edges are places where intensity changes quickly, which is where the gradient is large. Sobel uses two 3x3 kernels that approximate the partial derivatives in x and y, then combines them: mag = sqrt(gx^2 + gy^2). Prewitt is the simpler 3x3 average of differences; Roberts uses a 2x2 diagonal difference.
The Canny edge detection pipeline| Operator | Order | Noise sensitivity | Edge thickness |
|---|
| Roberts | 1st, 2x2 | High | Thin |
| Prewitt | 1st, 3x3 | Medium | Medium |
| Sobel | 1st, 3x3 | Medium | Medium |
| Laplacian | 2nd, 3x3 | Very high | Double response |
Thresholding the gradient
Pixels whose gradient magnitude exceeds the threshold are marked as edges. A low threshold keeps weak edges and noise; a high threshold keeps only strong boundaries but may break contours.