DIP Exp 3 . [ Grey level Slicing ]
clc;
close all;
clear all;
p=imread('sample.jpg');
[row col]=size(p);
z=double(p);
[row col]=size(z);
% t=input('Enter slicing limits (between 0 to 255)= ') % enter between 100 to 150 for pout.
for i=1:1:row
for j=1:1:col
if ((z(i,j)>100)) && ((z(i,j)<150))
z(i,j)=255;
else
z(i,j)=0;
end
end
end
subplot(2,1,1);
imshow(p)
subplot(2,1,2);
imshow(uint8(z))