0% found this document useful (0 votes)
57 views4 pages

DIP Assignment 5

This document is a student's submission of their Digital Image Processing assignment. It includes the student's name, enrollment number, class, and date. The assignment asks the student to apply an appropriate Sobel filter to an example image to calculate the magnitude and angle images. The student provides the code applied, shows the resulting magnitude and angle images, and justifies the outputs. They explain that the magnitude image shows abrupt changes and can be used to detect edges by applying a threshold. They also explain that the angle image helps depict the direction of edges by giving the orientation based on the gradient values.

Uploaded by

Saad Ali Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views4 pages

DIP Assignment 5

This document is a student's submission of their Digital Image Processing assignment. It includes the student's name, enrollment number, class, and date. The assignment asks the student to apply an appropriate Sobel filter to an example image to calculate the magnitude and angle images. The student provides the code applied, shows the resulting magnitude and angle images, and justifies the outputs. They explain that the magnitude image shows abrupt changes and can be used to detect edges by applying a threshold. They also explain that the angle image helps depict the direction of edges by giving the orientation based on the gradient values.

Uploaded by

Saad Ali Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Digital Image Processing

Assignment 5

Submitted by:
Student Name: Syed Saad Ali Shah

Enrolment No.: 01-134-171-075

Class and Section: BSCS-7A

Submitted to: Dr. Sumaira Kausar

Department of Computer Science


BAHRIA UNIVERSITY, ISLAMABAD

Assignment#5: Segmentation Basics in Image Processing


Question:

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

The magnitude of this vector is given by:

Apply zero paddings for border values


32 40 51 71 80 63

20 0 20 20 0 40

32 0 20 258 330 261

63 40 272 579 311 410

80 282 510 28 565 284

63 402 261 568 284 14

The magnitude of this vector is given by:

Gradient Angle:

72 -90 79 82 -90 -72

0 0 0 0 0 0

-18 0 90 -36 -92 -32

18 -90 -54 -45 -135 -1

0 -45 -50 45 135 39

-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.

You might also like