Image Processing Reference
In-Depth Information
(a)
(b)
(c)
FIGURE 9.3
(a) Noisy heart image, (b) edge image using Lukasiewicz operator and (c) edge image using
Hamacher
t
-operator utilizing the intuitionistic fuzzy approach.
9.6 Implementation in MATLAB
®
A MATLAB
®
code for image edge detection is given, which will be beneficial
to the readers to implement the method.
An example to find the gradient image using dilation-erosion is given where
Hamacher
t
-norm and
t
-conorms are used in the erosion-dilation computation:
clear all
image= imread('cameraman.tif');
dim1=240;dim2=dim1;row=dim1;dim=dim1;
img1=imcrop(image,[1 1 dim-1 dim-1]);
figure,imshow(img1)
fil=fspecial('gaussian',5,0.6);
filimg=uint8(filter2(fil,img1));
img=double(img1);
mx=max(max(img));
mem1=img./mx;
newim = mem1;
p1=0.2;p=0.8;
c = [0,p,0;p,1,p;0,p,0]; % structuring element
dim11=dim1+2;dim21=dim2+2;
arow1=zeros(1,dim);
w1=[arow1;newim;arow1];
acol2=ones(dim+2,1);
acol1=zeros(dim+2,1);
fd2=[acol1,acol1,w1];
fe3=[acol2,w1,acol2];
lambda=3;
% performing erosion - dilation operation
for j=2:dim2+1
for i=2:dim1+1
imd=[fd2(i-1,j-1),fd2(i,j-1),fd2(i+1,j-1);fd2(i-1,j),fd2(i,j),...
fd2(i+1,j);fd2(i-1,j+1),fd2(i,j+1),fd2(i+1,j+1)];
Search WWH ::
Custom Search