Analyzing Edge Detection Techniques with Gaussian Noise

.docx

School

University of Windsor *

*We aren’t endorsed by this school

Course

MV2022

Subject

Electrical Engineering

Date

Jun 12, 2024

Type

docx

Pages

12

Uploaded by CountInternetButterfly38

Electrical Engineering 24 Assignment 1 Subject: ELEC 8540 - Automotive Sensor Systems Student’s Name: Mohammad Fatin Fatihur Rahman Student ID: 110155510 Department: Electrical and Computer Engineering Instructor’s Name: Professor Q.M. Jonathan Wu Date:
Answer to the Question no: 1 In this question we are supposed to apply different edge detection techniques and analyse the performance of each. To start with, first we load the image ‘lena.bmp’ into the MATLAB. Use ‘imnoise’ command to add Gaussian noise (of variance: 0.01, 0.05, 0.1, 0.5, 1) in the image. Results of the image are as shown below. X=imread( 'lena.jpg' ); %Read lena.jpg image to matlab imshow(X) %Show lena.jpg image %% Adding Gaussian noise of different variance%% BW1=imnoise(X, 'gaussian' ,0,0.01); %var = 0.01 BW2=imnoise(X, 'gaussian' ,0,0.05); %var = 0.05 BW3=imnoise(X, 'gaussian' ,0,0.1); %var=0.1 BW4=imnoise(X, 'gaussian' ,0,0.5); %var=0.5 BW5=imnoise(X, 'gaussian' ,0,1); %var=1 tiledlayout(2,3); nexttile; imshow(X); title( 'Original Image' ); nexttile; imshow(BW1); title( 'var = 0.01' ); nexttile; imshow(BW2);title( 'var = 0.05' ); nexttile; imshow(BW3); title( 'var = 0.1' ); nexttile; imshow(BW4); title( 'var = 0.5' ); nexttile; imshow(BW5); title( 'var = 1.0' );
Next, A reference image is generated using the Canny edge detector (threshold = 0.1, sigma = 1) when there is no gaussian noise. Command used is: X = edge(I, 'canny' ,threshold,sigma) %% Generating refference image %% Ref = edge(X, 'canny' ,0.1,1); imshow(Ref); Now, perform the various edge detection techniques on the Gaussian noise images generated earlier, and for this we use ‘edge’ command. - Sobel Edge Detection Technique %% Performing sobel edge detection on Gaussian noise images %% BWS1 = edge(BW1, 'sobel' ); BWS2 = edge(BW2, 'sobel' ); BWS3 = edge(BW3, 'sobel' ); BWS4 = edge(BW4, 'sobel' ); BWS5 = edge(BW5, 'sobel' ); tiledlayout(2,3); nexttile; imshow(BWS1); title( 'Sobel for BW1' ); nexttile; imshow(BWS2); title( 'Sobel for BW2' ); nexttile; imshow(BWS3); title( 'Sobel for BW3' ); nexttile; imshow(BWS4); title( 'Sobel for BW4' ); nexttile; imshow(BWS5); title( 'Sobel for BW5' );
- Prewitt Edge Detection Technique %% Performing Prewitt edge detection on Gaussian noise images %% BWP1 = edge(BW1, 'prewitt' ); BWP2 = edge(BW2, 'prewitt' ); BWP3 = edge(BW3, 'prewitt' ); BWP4 = edge(BW4, 'prewitt' ); BWP5 = edge(BW5, 'prewitt' ); tiledlayout(2,3); nexttile; imshow(BWP1); title( 'Prewitt for BW1' ); nexttile; imshow(BWP2); title( 'Prewitt for BW2' ); nexttile; imshow(BWP3); title( 'Prewitt for BW3' ); nexttile; imshow(BWP4); title( 'Prewitt for BW4' ); nexttile; imshow(BWP5); title( 'Prewitt for BW5' );
- Laplacian of Gaussian Edge Detection Technique %% Performing Laplacian of Gaussian edge detection on Gaussian noise images %% BWL1 = edge(BW1, 'log' ); BWL2 = edge(BW2, 'log' ); BWL3 = edge(BW3, 'log' ); BWL4 = edge(BW4, 'log' ); BWL5 = edge(BW5, 'log' ); tiledlayout(2,3); nexttile; imshow(BWL1); title( 'Laplacian of Gaussian for BW1' ); nexttile; imshow(BWL2); title( 'Laplacian of Gaussian for BW2' ); nexttile; imshow(BWL3); title( 'Laplacian of Gaussian for BW3' ); nexttile; imshow(BWL4); title( 'Laplacian of Gaussian for BW4' ); nexttile; imshow(BWL5); title( 'Laplacian of Gaussian for BW5' );
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help