by Shenghan Zhou
The gradient magnitude computation involves determining the strength of changes in intensity at each point in an image. Filters like \( D_x = \begin{bmatrix} -1 & 1 \end{bmatrix} \) and \( D_y = \begin{bmatrix} -1 \\ 1 \end{bmatrix} \) are finite difference operators to estimate the gradient in the horizontal and vertical directions, respectively.
This is a horizontal gradient filter that computes the difference between adjacent pixels in the x-direction (left to right). It measures the change in intensity between a pixel and its neighbor.
This is a vertical gradient filter that computes the difference between adjacent pixels in the y-direction (top to bottom). It measures the change in intensity between a pixel and the pixel below it.
Once you apply these filters to the image, you get two gradients at each pixel location: one in the x-direction (\( G_x \)) and one in the y-direction (\( G_y \)). The magnitude of the gradient at each point can be computed using:
\[ |\nabla I| = \sqrt{G_x^2 + G_y^2} \]
\[ G_{x} \] |
\[ G_{y} \] |
gradient magnitude |
binary magnitude |
The threshold for the binary magnitude is set to 80. If a pixel’s value exceeds 20, it is considered part of an edge.
\[ G_{x} \] |
\[ G_{y} \] |
gradient magnitude |
binary magnitude |
Convolving the gaussian with \[D_x\] |
Convolving the gaussian with \[D_y\] |
\[ G_{x} \] |
\[ G_{y} \] |
gradient magnitude |
binary magnitude |
\[\alpha=0\] |
\[\alpha=1\] |
\[\alpha=2\] |
\[\alpha=3\] |
\[\alpha=4\] |
Original image |
\[\alpha=1\] |
\[\alpha=2\] |
\[\alpha=3\] |
\[\alpha=4\] |
Original image |
Blurring image |
\[\alpha=1\] |
\[\alpha=2\] |
\[\alpha=3\] |
\[\alpha=4\] |
original image |
original image |
hybrid image |
original image |
original image |
hybrid image |
Big dog | Man in suit | Mask |
Cute cat | Owl | Mask |