DIP Assignment 5
DIP Assignment 5
Assignment 5
Submitted by:
Student Name: Syed Saad Ali Shah
Apply appropriate Sobel filter on the given image to calculate the magnitude and angle
image. Justify the resultant image.
0 0 0 0 0 0
10 10 10 20 20 20
0 0 0 0 0 0
0 20 0 10 200 0
0 20 0 200 10 0
0 20 200 0 0 10
Solution:
Gx Gy
20 0 20 20 0 40
Gradient Angle:
0 0 0 0 0 0
-18 -6 -58 46 51 45
Justification:
We get two outputs images for magnitude and angle. Results show that there are sharp changes in the
intensity values. The magnitude image shows abrupt changes. Values are very large, so, we will apply a
threshold and say that value greater then that is a certain edge and lesser values than the threshold will be
assigned zero. The magnitude image will show edges in the images as we applied Sobel filters in the Matlab
also for edge detection in the realtime also.
The angled image helps us to depict the direction of the edge in a particular image. The orientation of
the edge is given by inverse tan of Gx over Gy, if we take gradient result from Gy and Gx and divide them and
take inverse tan of that it will give the value which will say in which orientation in the image that pixel is. And
that will be very helpful in finding the edges of structures and objects.