[go: up one dir, main page]

0% found this document useful (0 votes)
146 views1 page

Canny Edge Detection Code

This document loads and preprocesses an image file, applying various edge detection and filtering techniques to extract features from the grayscale image. It converts the color image to grayscale, applies Canny edge detection with different threshold values, and convolves the image with Gaussian filters of varying kernel sizes and standard deviations to blur the image.

Uploaded by

Putu Adi Susanta
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 DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
146 views1 page

Canny Edge Detection Code

This document loads and preprocesses an image file, applying various edge detection and filtering techniques to extract features from the grayscale image. It converts the color image to grayscale, applies Canny edge detection with different threshold values, and convolves the image with Gaussian filters of varying kernel sizes and standard deviations to blur the image.

Uploaded by

Putu Adi Susanta
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 DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

cd e:\matlab\images\ ls A = imread('mckeldin1.

jpg'); imagesc(A); pause; truesize; size(A) Abw= rgb2gray(A); imagesc(Abw); colormap(gray); pause %imshow(edge(Abw, 'canny', [],1); [Bbw, thresh] = thresh figure; imagesc(Bbw); colormap(gray); pause [Bbw2, thresh] = figure; colormap(gray); imagesc(Bbw2); pause; edge(Abw, 'canny');

edge(Abw, 'canny',[],2);

[Bbw3, thresh] = edge(Abw, 'canny',[],3); figure; colormap(gray); imagesc(Bbw3); thresh pause figure; G= fspecial('gaussian',[6 6],1) imagesc(conv2(Abw, G)); colormap(gray); pause G= fspecial('gaussian',[9 9],2) imagesc(conv2(Abw, G)); colormap(gray);

You might also like