You are on page 1of 6

INDEX

S.No Experiment Signature


Introduction to basic commands of image
1. processing on MATLAB
Implement of 2D convolution and other
2. transformations.
To compute the 2D DFT of a 2D rectangle
3. signal or an image.
Image Enhancement (Time domain methods):
(a) Enhancement by point processing:
(i) Implement Gray level slicing.
(ii) Read an image and to extract 8 different
4. planes, that is, bit plane slicing.
(iii)Read an image, plot its histogram then do
histogram equalization.
(iv) To reduce noise using image averaging.
Spatial Filtering: Implement various
5. smoothing and sharpening spatial filters.
Image Enhancement (Frequency domain
methods):
(i) Low pass filtering with different masks
6. (ii) High pass filtering with different masks
(iii)Order-static filters (Median filters)
(iv) High boost filtering
Convert an image into gray level and then
7. apply different operators to detect edges in
different way.
8. Rotation ,translation and scaling of an image.
Experiment 7

AIM: Convert an image into gray level and then apply


different operators to detect edges in
different way.

THEORY:
All the derivative masks should have the following properties-
• Opposite sign should be present in the mask.
• Sum of mask should be equal to zero.
• More weight means more edge detection.
1) PREWITT OPERATOR-
Prewitt operator provides us two masks one for detecting edges in
horizontal
direction and another for detecting edges in an vertical direction.
1. VERTICAL EDGE DETECTION
2. HORIZONTAL EDGE DETECTION
Both detections followed the rules of derivative.
2) SOBEL OPERATOR-
Sobel operator is also used to detect two kinds of edges in an
image:
1. VERTICAL DIRECTION
2. HORIZONTAL DIRECTION
The major difference is that in Sobel operator the coefficients of
masks are not fixed and
they can be adjusted according to our requirement unless they do
not violate any property of
derivative masks.
3) LAPLACIAN OPERATOR-
Is also a derivative operator which is used to find edges in an
image.
• Laplacian is a second order derivative mask.
• didn’t take out edges in any particular direction but it take out
edges in following
classification:
• Inward Edges
• Outward Edges
• Positive Laplacian Operator

• In Positive Laplacian we have standard mask in which center


element of the mask should be
negative and corner elements of mask should be zero.
• Positive Laplacian Operator is use to take out outward edges in
an image.
• Negative Laplacian Operator:
• In negative Laplacian operator we also have a standard mask, in
which center element should
be positive. All the elements in the corner should be zero and rest
of all the elements in the
mask should be -1.
•Negative Laplacian operator is use to take out inward edges in an
image

CODE:
clc
clear all
close all
a=imread('Bird.jpg');
b=rgb2gray(a);
subplot(3,3,1)
imshow(b)
title('Original gray image')
% % SOBEL OPERATOR
m=[-1 -2 -1;0 0 0;1 2 1]
c=conv2(m,b);
subplot(3,3,2)
imshow(c)
title('Horizontal edge detection SOBEL')
m1=[-1 0 1;-2 0 2;1 0 -1]
d=conv2(m1,b);
subplot(3,3,3)
imshow(d)
title('Vertical edge detection SOBEL')
% % PREWITT OPERATOR
m2=[-1 1 -1;0 0 0;1 -1 1]
e=conv2(m2,b);
subplot(3,3,4)
imshow(e)
title('Horizontal edge detection PREWITT operator ')
m3=[-1 0 1;1 0 -1;1 0 -1]
f=conv2(m3,b);
subplot(3,3,6)
imshow(f)
title('Vertical edge detection PREWITT operator')
% % LAPLACIAN OPERATOR

m4=[0 1 0;1 -4 1;0 1 0]


g=conv2(m4,b);
subplot(3,3,7)
imshow(g)
title('Positive LAPLACIAN operator')
m5=[0 -1 0;-1 4 -1;0 -1 0]
h=conv2(m5,b);
subplot(3,3,9)
imshow(h)
title('Negative LAPLACIAN operator')
subplot(3,3,8)
imshow(h)
title('negative LAPLACIAN operator')

OUTPUT:

EXPERIMENT 8
AIM: Rotation, translation and scaling of an image.

CODE:
clc;
close all;
clear all;
I=imread('Bird.jpg');
%rotate the image
a=imrotate(I,-30,'bilinear','crop');
%resize the image
b=imresize(I,0.5,'nearest');
% translate the image
c=imtranslate(I,[30, 100]);
figure
imshow(a);
title('Rotated Image')
figure
imshow(b);
title('Scaled Image')
figure
imshow(c);
title('Translated Image')

OUTPUT:

You might also like