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

Report
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' );
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
- 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' );
- Canny Edge Detection Technique %% Performing Canny edge detection on Gaussian noise images %% BWC1 = edge(BW1, 'canny' ); BWC2 = edge(BW2, 'canny' ); BWC3 = edge(BW3, 'canny' ); BWC4 = edge(BW4, 'canny' ); BWC5 = edge(BW5, 'canny' ); tiledlayout(2,3); nexttile; imshow(BWC1); title( 'Canny for BW1' ); nexttile; imshow(BWC2); title( 'Canny for BW2' ); nexttile; imshow(BWC3); title( 'Canny for BW3' ); nexttile; imshow(BWC4); title( 'Canny for BW4' ); nexttile; imshow(BWC5); title( 'Canny 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
For performing quantitative analysis of the performance of Edge Detection techniques, we use Root Mean Square Error (RMSE). Where R indicates the number of image rows and C refers to the number of columns, f(I,j) refers to the image with detected edges using different methods at various gaussian noise levels and f’(I,j) represents the reference image. %% Quantitative performance analysis of different edge detectors using RSME metric %% %% Sobel edge detector at different noise level %% MSES_1 = (1/(512*512))*(sum((BWS1 - Ref).^2,'all')); MSES_2 = (1/(512*512))*(sum((BWS2 - Ref).^2, 'all' )); MSES_3 = (1/(512*512))*(sum((BWS3 - Ref).^2, 'all' )); MSES_4 = (1/(512*512))*(sum((BWS4 - Ref).^2, 'all' )); MSES_5 = (1/(512*512))*(sum((BWS5 - Ref).^2, 'all' )); %% Prewitt edge detection at different noise level %% MSEP_1 = (1/(512*512))*(sum((BWP1 - Ref).^2,'all')); MSEP_2 = (1/(512*512))*(sum((BWP2 - Ref).^2, 'all' )); MSEP_3 = (1/(512*512))*(sum((BWP3 - Ref).^2, 'all' ));
MSEP_4 = (1/(512*512))*(sum((BWP4 - Ref).^2, 'all' )); MSEP_5 = (1/(512*512))*(sum((BWP5 - Ref).^2, 'all' )); %% Laplacian od Gaussian edge detection at different noise level %% MSEL_1 = (1/(512*512))*(sum((BWL1 - Ref).^2,'all')); MSEL_2 = (1/(512*512))*(sum((BWL2 - Ref).^2, 'all' )); MSEL_3 = (1/(512*512))*(sum((BWL3 - Ref).^2, 'all' )); MSEL_4 = (1/(512*512))*(sum((BWL4 - Ref).^2, 'all' )); MSEL_5 = (1/(512*512))*(sum((BWL5 - Ref).^2, 'all' )); %% Canny edge detection at different noise level %% MSEC_1 = (1/(512*512))*(sum((BWC1 - Ref).^2,'all')); MSEC_2 = (1/(512*512))*(sum((BWC2 - Ref).^2, 'all' )); MSEC_3 = (1/(512*512))*(sum((BWC3 - Ref).^2, 'all' )); MSEC_4 = (1/(512*512))*(sum((BWC4 - Ref).^2, 'all' )); MSEC_5 = (1/(512*512))*(sum((BWC5 - Ref).^2, 'all' )); Results: The performance of each filter is analysed by comparing the result of each edge detector with th reference image, thus taking the square root of all the values will give the RSME value. Because higher the RSME value, the performance is poor the RSME values are compared in a tabular form as follows. RMSE value of different Edge Detectors with different variance or noise Variance Sobel Prewitt LoG Canny 0.01 0.0876 0.0872 0.1488 0.2003 0.05 0.1010 0.1005 0.2090 0.2952 0.1 0.1020 0.1020 0.2252 0.3181 0.5 0.0985 0.0986 0.2447 0.3455 1 0.0970 0.0970 0.2494 0.3498
Answer to the Question no: 2 Performance analysis of Canny Edge Detector with varying threshold value. Here we have taken two different set of parameters. In Figure 7, Canny Edge Detector is used with different threshold at 0.01, 0.1, 0.2, 0.5 and sigma at 1 and 4. In case 1, we have taken threshold = 0.01, 0.1, 0.2, 0.5 and sigma = 1. To analyse the be performance od Canny edge detector, we use two threshold levels: high and low. So, the edges upwards of high threshold are detected while the lower threshold edges are not detected. Therefore, from figure 7 we can see that when the threshold is small (0.01), more edges are detected. With the increase in threshold, the intensity of edge detection decreases i.e., weak edges do not appear.
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
Case 2: Here the value of threshold remains same but sigma = 4. We can see the with the increase in the sigma value, the noise in the image is reduced. So, we can say that with the increase in the sigma value, the week edges are not detected.
Answer to the Question no: 3 Canny edge detection is an image processing method used to detect edges on an image while supressing noise. The Canny Edge can detect horizontal, vertical, and circular edges and edges at the corners. Canny edge Detector detects maximum edges thus providing a high-quality edge image compared to other counterparts. This method uses two threshold values which results to detection of strong as well as week edges resulting to efficient edge detection. Canny edge detector uses two parameters; Threshold and sigma, which can be adjusted to increase its effectiveness thus gives good localization. The Gaussian noise present in the Canny Edge detector helps removing the noise and the signal is also enhance with respect to noise ratio by non-maxima suppression method which produces output of wide pixel range.
Answer to the Question no: 4 The Unconstrained Natural environment consist of many noise factors and high noise level, so it becomes critical to detect the true edges of the image. Conditions like these consist of variety of natural and artificial noise and disturbances that effect the Edge detectors. Since edge Detectors are highly sensitive, results change to minute errors therefore change the results. Therefore, Directional Edge Detectors are used for better performance. It is important to avoid the false negative and false positive in edge for better performance. The edge detection and gradient are used to detect the true edges of the image. The Edge Detection is the vector along the edge, which is perpendicular to the edge normal. The edge normal is a vector in the direction of maximum intensity change in the image. The Directional Edge Detector uses gradient vector at each image pixel by assuming the image with horizontal derivatives and vertical derivative filter, later computing gradient magnitude at each pixel. Thus, if the magnitude is higher than threshold, it is a true edge point. So, it is evident that Directional Edge Detectors perform better under unconstrained natural environment, where the noise is too high.
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