Experiment No.03: LAB Manual Part A
Experiment No.03: LAB Manual Part A
Experiment No.03: LAB Manual Part A
PART A
(PART A : TO BE REFFERED BY STUDENTS)
Experiment No.03
A.1 Aim:
Implementation of Point Processing image enhancement Operations in Spatial Domain.
A.2 Prerequisite:
1 Matlab programming syntax (Refer the Matlab manual).
2.Knowledge of point processing operations.
3. Availability of Soft copy of your Photograph for experiment.
A.3 Outcome:
After successful completion of this experiment students will be able to
a. Negation of an image
b. Thresholding of an image
c. Contrast Stretching of an image
d. Gray level Slicing
e. Bit Plane slicing.
2.Understand the effect of point processing operations on an Image.
3. Identify the real life application of point processing techniques implemented.
A.4 Theory:
a. Negation of an image
The negative of an image with gray levels in the range [ 0, L-1] is obtained by using the negative
transformation given by the expression
S= L – 1 – r …… Equation (1)
b. Thresholding of an Image
Theory:
Thresholding is a simple process to separate the interested object from the background. It gives
the binary image. The formula for achieving thresholding is as follows
Where: f(x, y) is the Piecewise Linear Contrast Stretch in the image, a, b, and c are appropriate
constants, which are the slopes in the respective regions and B is the maximum intensity value.
The location of the points (r1 , s1) & (r2 , s2) control the shape of the transformation function.
highlight a range of intensities while diminishing all others to a constant low level.
The fig. illustrates the intensity level slicing process. The left figures show a transformation
function that highlights a range [A,B] while diminishing all the others. The right figures
highlights a range [A,B] but preserves all the others.
Figure 4: The concept of Gray level slicing with and without background
S = 0; Otherwise
S = r; Otherwise
Theory:
Bit plane slicing is new way of looking at an image. In bit plane slicing the image is considered
to be a stack of binary images. The images closes to the bottom are least significant and the
images on top are most significant. Instead of highlighting intensity ranges, highlighting the
contribution made to the total image appearance by specific bit might be desired. Imagine that
the image is composed of eight 1-bit planes, ranging from plane 0 for least significant bit to plane
7 for the most significant bit.
Figure 5. A model of the bit-planes
A.5 Procedure/Algorithm:
A.5.1 TASK 1:
Negation of an image
Thresholding of an Image
A.5.4 TASK 4:
A.5.5 TASK 5:
**********************
PART B
(PART B : TO BE COMPLETED BY STUDENTS)
(Students must submit the soft copy as per following segments within two hours of the
practical. The soft copy must be uploaded on the Blackboard or emailed to the concerned
lab in charge faculties at the end of the practical in case the there is no Black board access
available)
TASk 1
clc;
clear all;
myImage=imread('C:\Users\mpstme.student\Documents\B019/img1.jpg');
Img=rgb2gray(myImage);
imshow(Img);
c=imresize(Img,[256,256],'nearest');
max=0;
for i=1:256
for j=1:256
if(max<c(i,j))
max=c(i,j)
end
end
end
disp(max);
for i=1:256
for j=1:256
c(i,j)=max-c(i,j);
end
end
imshow(c);
Task 2
clc;
clear all;
myImage=imread('C:\Users\mpstme.student\Documents\B019/img1.jpg');
Img=rgb2gray(myImage);
%imshow(Img);
og=imresize(Img,[256,256],'nearest');
c=imresize(Img,[256,256],'nearest');
d=imresize(Img,[256,256],'nearest');
e=imresize(Img,[256,256],'nearest');
t1=10;
t2=80;
t3=180;
%imshow(og);
for i=1:256
for j=1:256
if(c(i,j)<t1)
c(i,j)=0;
else
c(i,j)=255;
end
end
end
imshow(c);
for i=1:256
for j=1:256
if(d(i,j)<t2)
d(i,j)=0;
else
d(i,j)=255;
end
end
end
%imshow(d);
for i=1:256
for j=1:256
if(e(i,j)<t3)
e(i,j)=0;
else
e(i,j)=255;
end
end
end
%imshow(e);
TASK 3
Output:
1)
2)
a-
b-
c-
3)
B.4 Conclusion:
(Students must write the conclusion as per the attainment of individual outcome listed above and
learning/observation noted in section B.3)
Solve following: a * f1 + (1- a) * f2 Where a = 0.5, f1 = your image and f2 = your neighbor
classmate’s image
************************