In this class, we will learn about Image Gradients and Gradient Filtering.
● Image Edge
We can view an image as a 2D function.
How can we detect an edge?
What kinds of filter should we use?
● Forward Difference
We have learned the formula above in high school.
The derivative of a function f at a point x is defined by the limit.
The formula above is the approximation of the derivative when h is small.
This definition is based on the 'forward difference'.
● Central Difference
However, it turns out that using the 'central difference' is more accurate.
Then, how do we compute the derivative of a discrete signal?
● Sobel Filter
The filter above is a derivative filter with some smoothing.
FIlter returns large response on horizontal edges.
The output can be positive or negative.
Left one is the original image, and the middle one is a derivative in X direction.
Right one is a derivative in Y direction.
We can visualize negative derivatives or gradients with scaled absolute value.
Then, where does this filter from?
● Decomposing the Sobel Filter
Let's decompose the Sobel Filter.
The Sobel Filter is composed of weighted average & scaling, and x-derivative.
The Sobel Filter only returns the x and y edge responses.
● Computing the Image Gradient
How can we compute the image gradient?
① Choose a Derivative Filter
② Run Filter over Image
③ Store Image Gradient
● Image Gradient
As you can see the pictures above, gradient in x only, has a form of y being 0.
Likewise, gradient in y only, has a form of x being 0.
If we want to consider gradient in both x and y, we should differentiate f with both x and y.
* Gradient Direction
* Gradient Magnitude
● Common Derivative Filters
① Sobel
② Scharr
③ Prewitt
④ Roberts
● Finding edge from signal
We can also find the edge from the signal by using a derivative filter.
Then we can get a derivative plot.
But derivative filters are sensitive to noise.
We shouldn't forget to smooth before running derivative filters.
● Laplace Filter
Laplace Filter looks like a straw hat.
The formula above is the first-order finite difference. We can get derivative filter.
If we apply second-order finite difference above,
we can get Laplace filter like above.
Then what would happen if we apply Laplacian to the intensity plot?
Zero crossings are more accurate at localizing edges.
Second derivative is noisy.
● 2D Laplace Filter
If the Sobel filter approximates the first derivative, the Laplace filter approximates to the second derivative.
Then what's the difference between Laplace filter and Sobel filter?
If we look in detail, zero crossings are more accurate at localizing edges.
(but not very convenient)
● Summary
In next class, we will learn about Filtering vs Convolution.
'AI > Computer Vision Materials' 카테고리의 다른 글
5.0 Defining Boundaries (0) | 2020.08.05 |
---|---|
4.1 Filtering vs Convolution (0) | 2020.08.05 |
3.1 Image Pyramid (0) | 2020.08.03 |
3.0 Image Subsampling (0) | 2020.08.03 |
2.3 Gaussian Filter (0) | 2020.08.03 |