Human Face Recognition

Edge detection of 2 different alphanumeric char & their crosscorrelation



 

MATLAB Program 7

%edge detection of 2 different alphanumeric char & their crosscorrelation

I = imread('apple1.bmp');

Imshow(I);figure;

J= imread('file.bmp');

Imshow(J);figure;

%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 1.4])

 

 

 

                        Figure 1                                                                  

 

 

                           Figure 2

                             Figure 3


                                       Figure4

 

 

 

                                                                            Figure5

                  First of all two alphabets “A” & “F” are read in two 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 two different 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.