Image Processing Reference
In-Depth Information
tot_var=sum(sum(abs(im-med_im)));
diff_im (i-1,j-1)= tot_var;
end
end
figure,imshow(diff_im)
max(max(diff_im))
fil=fspecial('gaussian',3,0.01);
fil1=uint8(filter2(fil,diff_im));
edge_im=edge(fil1,'canny',0.45);
figure,imshow(edge_im);
8.7.2 An Example to Find the Fuzzy Edge Image
image=imread('cell2.jpg');
a1=rgb2gray(image);
a2=dyaddown(a1,'m',1);a3=dyaddown(a2,'m',1);
dim1=150;dim2=dim1; row =dim1;col=dim2;
alpha=0.75;
img=imcrop(a1,[2 1 dim2-1 dim1-1]);
figure,imshow(img)
b1=double(img);
mx=max(max(b1));
img=b1/mx;
% replicate the edge pixels
edgim=zeros(dim1,dim2);
dim11=dim1+1;dim21=dim2+1;
edgimage = zeros(dim11,dim21);
r1=img(2,:); r2=img(row-1,:); c1=img(:,2); c2 = img(:,col-1);
bor1=[0,r1,0];bor2=[0, r2, 0];
p1=[c1,img,c2]; f2=[bor1;p1;bor2];
f2(1,1)=img(1,1); f2(row+2,col+2) =img(row,col);f2(1,col+2) =
img(1,col);
f2(row+2,1)= img(row,1);
% calculating the upper and lower membership levels for each window
for i =2:dim11
for j=2:dim21
im =
  [f2(i-1,j-1),f2(i,j-1),f2(i+1,j-1);f2(i-1,j),f2(i,j),
f2(i+1,j);f2(i-1,j+1),f2(i,j+1),f2(i+1,j+1)];
mxwin=max(max(im)); mnwin=min(min(im));
% upper and lower membership levels of max value of
the window
mxwin_high= mxwin.^alpha;
mxwin_low=  mxwin.^(1/alpha);
% upper and lower membership levels of min value of
the window
mnwin_high= mnwin.^alpha;
mnwin_low=  mnwin.^(1/alpha);
Search WWH ::




Custom Search