
|
Purpose: The purpose of this homework is to experiment smoothing and edge detection:
Background: The Sobel operator uses a 3 by 3 matrix with utilized to preserve the edges. The matrix is as follows:
-1 0 1 1 2 1 -2 0 2 0 0 0 -1 0 1 1 2 1 Dx Dy If a binary (i.e., black and white) version of the gradient map is desired, it can be obtained by thresholding. All gradient values whose magnitudes are less than a threshold will be set to 255 and all gradient magnitudes greater than a threshold will be set to 0. Thus, the maximum image contrast is compressed to 1 bit. Black and White Edge detection: We will use some predetermined imaged and demonstrate how the Edge detection works.
Figure 1 Original image afg1
Figure 2 – Output of Afg1 Above are the 4 output images. These images were obtained by using Threshold of 30 and Angle of 90. We use Threshold of 50 and angle of 80 to get the following images from Afg2.
Figure 3 Original Afg2
Figure 4 – Output of Afg2
Figure 5 – Original Afg3
Figure 6 –Output Afg3 Another image that I found was interesting is a coke can displayed below
Figure 7 I changed the expression for the final output to exclude the edge of 90 degrees, and the output is very interesting in my opinion. I was able to filter out the 90 degree lines.
Figure 8 - Edge preserving output with 3by3 matrix and threshold of 80
After smoothing the above image I applied the Sobel operator.
Figure 9 – Sobel operator was applied on already smoothed image Edge Direction Filtering to isolate the runway. I tried to isolate the runway of afg1 but for some reason I was not able to do so. I think that my Gradient is not working properly.
I also change the threshold to 90 and applied to Sobel to the Coke image. The result is as follows.
Figure 1 Threshold is 90.
Figure Threshold is 150 Conclusion: The Sobel operation is useful in isolating the lines in particular angles. By utilizing the Threshold and the user input angle, it is possible to isolate the lines, which are on the same angle as indicated by the user. |
||
|
||
![]()