Group No: 50 ROLL NO: 1704108: EXPERIMENT 6: Implement Image Negative, Gray Level Slicing and Thresholding
Group No: 50 ROLL NO: 1704108: EXPERIMENT 6: Implement Image Negative, Gray Level Slicing and Thresholding
Theory:
Point Processing Techniques are among the simplest of all image enhancement techniques.
1. Negative of an Image:
2. Thresholding:
It displays high values in the specific region of an image and low values to other
regions by ignoring background.
NEGATIVE IMAGE
a = imread("My_photo.jpg");
sz = size(a);
for i = 1: sz(1)
for j = 1:sz(2)
end
end
figure(1);
imshow(a);
figure(2);
imshow(b)
Original Image
Negative Index
THRESHOLDING
image = imread('My_photo.jpg');
[r,c] = size(image);
s = image;
for i=1:r
for j=1:c
if(s(i,j)<100)
s(i,j) = 1;
end
end
end
figure(1),imshow(image);title('Original image');
figure(2),imshow(s);title('Thresholding image');
without_background = uint8(img);
with_background = uint8(img);
[n,m] = size(without_background);
l = 256;
for i=1:n
for j=1:m
%With out BackGround
without_background(i,j) = l-1;
else
without_background(i,j) = 0;
end
%With BackGround
end
end
end
figure,imshow(img);title('Original Image');
figure;
for i=1:n
for j=1:m
%With BackGround
without_background(i,j) = l-1;
end
end
end
figure;
imshow(with_background); title('Gray Level Slicing With BackGround');
Gray level Slicing without background Gray level Slicing with Background