Edges find from Image object boundaries.Edge Detection are mostly used in Image Processing,Computer Vision and Machine Vision Domains.In matlab edge find from gray level Images.In below we give the example of edge detection techniques.
Example code:
clc
clear all
close all
warning off
width = 256;
height = 256;
I = rgb2gray(imread('vivekananda.jpg'));
BW1 = edge(I,'sobel');
figure;imshow(BW1);
title('Sobel Edge Detection');
BW2 = edge(I,'prewitt');
figure;imshow(BW2);
title('prewitt Edge Detection')
BW3 = edge(I,'roberts');
figure;imshow(BW3);
title('roberts Edge Detection')
BW4 = edge(I,'log');
figure;imshow(BW4);
title('log Edge Detection')
BW5 = edge(I,'zerocross');
figure;imshow(BW5);
title('zerocross Edge Detection')
BW6 = edge(I,'canny');
figure;imshow(BW6);
title('canny Edge Detection')
output as follows
clc
clear all
close all
warning off
width = 256;
height = 256;
I = rgb2gray(imread('vivekananda.jpg'));
BW1 = edge(I,'sobel');
figure;imshow(BW1);
title('Sobel Edge Detection');
BW2 = edge(I,'prewitt');
figure;imshow(BW2);
title('prewitt Edge Detection')
BW3 = edge(I,'roberts');
figure;imshow(BW3);
title('roberts Edge Detection')
BW4 = edge(I,'log');
figure;imshow(BW4);
title('log Edge Detection')
BW5 = edge(I,'zerocross');
figure;imshow(BW5);
title('zerocross Edge Detection')
BW6 = edge(I,'canny');
figure;imshow(BW6);
title('canny Edge Detection')
output as follows
No comments:
Post a Comment