Human Face Recognition

MATLAB Program 5 edge detection of 2 same alphanumeric chars


%edge detection of 2 same alphanumeric chars using canny & their correlation using

%corr2 function

I = imread('apple1.bmp');

J= imread('apple2.bmp');

%J = imnoise(I,'salt & pepper',0.02);

BW1 = im2bw(I,.5);

BWA=uint8(BW1);%changes logical to uint8

BW2= im2bw(J,.5);

BWB=uint8(BW2);%changes logical to uint8

BW3 = edge(BWA,'canny');

BW4 = edge(BWB,'canny');

imshow(BW3);figure;

imshow(BW4);figure;

 %cov(count(:,1))

p=corr2(BW3,BW4);

%p=BW1 * BW2;

[X,Y]=meshgrid(-1:.005:1);

Z=peaks(p);

imshow(p);figure;

%plot(Z,p);

mesh(X,Y,Z);

Z = fspecial('gaussian');

figure, freqz2(Z,[64 64]), axis([-1 1 -1 1 0 .8])

 

 

 

                   Figure1                                                                                                                                                       

 

 

 

 

 

                          Figure 1

 

 

 

                             Figure 2

 

 

 

 

 

 

 

 

Figure3

 

 

 

 

                  First of all alphabet “A”  is read twice in variables I & J then two matrices are formed BW1 & BW2 . When we are working with “canny” it is unable to handle logical values so logical value is converted to uint8 format by using uint8() function.Then edge(BW1,’canny’) function  forms the sharp edges of two alphabets.Here also Gaussian filter is used in order to get the desired output thus we can conclude that they are same alphabets.

h= fspecial(type) creates a two-dimensional filter h of the specified type. fspecial returns h as a correlation kernel, which is the appropriate form to use with imfilter, “type” is a string having one of these values.

 

Want To Know more with

Video ???

Contact for more learning: webmaster@freehost7com

 

 

 

 

 

 

 

Home

The contents of this webpage are copyrighted © 2008 www.freehost7.com
 All Rights Reserved.