Gradients
Image Gradient Function
Direction
The gradient points in the direction of most rapid increase in intensity. For an image , the gradient's direction is given by:
Magnitude
The "amount of change" in the gradient is given by its magnitude:
Finite Differences
Discrete Gradient
We want an operator that we can apply to a kernel and use as a correlation (or convolution) filter.
Sobel Operator
The Sobel Operator is a discrete gradient operator that preserves the "neighborliness" of an image that we discussed earlier when talking about the Gaussian blur filter in Blurring Images. It looks like this:
Handling Noise
The images are very noise. To reduce the noise, we apply a smoothing filter.

Derivative Theorem of Convolution
We take advantage of associative of linearity property. This saves us one operation so we can calculate derivatives on the kernal

Second derivative of Gaussian
