Beruflich Dokumente
Kultur Dokumente
jpg')
[m n]=size(b);
d = zeros(m,n)
%Conversion to Binary Image
for i=1:m
for j=1:n
if(b(i,j)>128)
d(i,j) = 1;
else
d(i,j) = 0;
end
end
end
subplot(3,2,6)
imshow(d)
title('Binary')
%Processing on Segmentation
e = zeros(m/2,n/2)
f = zeros(m/2,n/2)
g = zeros(m/2,n/2)
h = zeros(m/2,n/2)
for i=1:m/2
for j=1:n/2
if(b(i,j) >128)
e(i,j) = 1;
else
e(i,j) = 0;
end
end
end
subplot(3,2,2)
imshow(e)
title('1/4th Segment')
for i=1:m/2
for j=n/2:n
if(b(i,j) >128)
f(i,j-255) = 1;
else
f(i,j-255) = 0;
end
end
end
subplot(3,2,3)
imshow(f)
title('1/2th Segment')
for i=m/2:m
for j=1:n/2
if(b(i,j) >128)
g(i-255,j) = 1;
else
g(i-255,j) = 0;
end
end
end
subplot(3,2,4)
imshow(g)
title('3/4th Segment')
for i=m/2:m
for j=n/2:n
if(b(i,j) >128)
h(i-255,j-255) = 1;
else
h(i-255,j-255) = 0;
end
end
end
subplot(3,2,5)
imshow(h)
title('4th Segment')
Egde expeiment
A=imread('E:/shipra/smile.jpg');
A=rgb2gray(A);
figure;imshow(A);
Y(i,j)=mat(2,2);
elseif(j==m && (i-1)~=0 && i~=n)
mat(:,1:2)=Y(i-1:i+1,j-1:j);
mat=sort(mat,1);
mat=sort(mat,2);
Y(i,j)=mat(2,2);
end
end
end
figure;
imshow(Y)