0% found this document useful (0 votes)
24 views

Lab 7

This document provides instructions for a lab on edge detection techniques. Students are asked to apply Sobel filters and Canny edge detection to images to extract edges. For Sobel filtering, they will calculate gradients in x and y, and the total gradient magnitude. For Canny edge detection, they will apply it with different threshold and sigma parameter settings to the image cameraman.tif and display the results. Hints are provided on how to implement the Sobel and Canny edge detection filters using Matlab functions.

Uploaded by

manish10111987
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Lab 7

This document provides instructions for a lab on edge detection techniques. Students are asked to apply Sobel filters and Canny edge detection to images to extract edges. For Sobel filtering, they will calculate gradients in x and y, and the total gradient magnitude. For Canny edge detection, they will apply it with different threshold and sigma parameter settings to the image cameraman.tif and display the results. Hints are provided on how to implement the Sobel and Canny edge detection filters using Matlab functions.

Uploaded by

manish10111987
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Computer Engineering Dept.

Faculty of Engineering Cairo University Digital Image Processing Lab

Lab 7 Edge Detectors


Notes: All the images used are in the folder MatlabRoot\toolbox\images\imdemos. Before doing any mathematical operation on the image, you must convert it to double. Before displaying the image after mathematical operations, you must convert it to uint8. Write each experiment as an M-file to test it. 1. Using the image circuit.tif a. Apply sobel filter to calculate the gradient in x Display the result b. Apply sobel filter to calculate the gradient in y Display the result c. Calculate the magnitude of the gradient as |G| = |Gx| + |Gy| Display the result

Hints
To construct the filter use the function fspecial(sobel) to get the filters Gx and Gy

To apply the filter use one of the 3 functions i. filter2() ii. imfilter() iii. conv2() 2. Using the image cameraman.tif apply Canny edge detection algorithm: a. Using thresholds [0.5 0.9] and sigma = 1 b. Using thresholds [0.04 0.1] and sigma = 1 (BONUS) c. Using thresholds [0.04 0.1] and sigma = 3 (BONUS)

Hints use the function edge():


o BW = edge(I, 'canny', thresh, sigma) where: thresh is a two-element vector in which the first element is the low threshold, and the second element is the high threshold. sigma is the standard deviation of the Gaussian filter.

Computer Engineering Dept. Faculty of Engineering Cairo University Digital Image Processing Lab

Original Image

Sobel Edges

Canny Edges with thresholds [0.5 0.9] and sigma = 1

Canny Edges with thresholds [0.04 0.1] and sigma = 1 (BONUS)

Canny Edges with thresholds [0.04 0.1] and sigma = 3 (BONUS)

You might also like