Line Detection Venkatesh
Line Detection Venkatesh
DATE :
LINE DETECTION
AIM:
To perform the line detection on the given medical images.
OBJECTIVES:
To perform line detection on the given medical image, with the following steps:
• Convert the image to grayscale.
• Apply a line detection masks such as horizontal, vertical, diagonal
kernels to identify corresponding lines in the given medical image.
THEORY:
• Line detection in image processing involves identifying and extracting linear features
or patterns from digital images.
• The Laplacian operator is applied to the preprocessed image. It calculates the second
derivative of the intensity values concerning x and y directions.
Img1 = imread("Brain_1.jpg");
figure;
subplot(321);
imshow(Img1);
title("Original Image");
Img2 = im2gray(Img1);
subplot(322);
imshow(Img2);
title("Grayscale of Original Image");
w2 = [-1,2,-1;-1,2,-1;-1,2,-1];
Img4 = imfilter(Img1,w2);
subplot(324);
imshow(Img4);
title("Vertical Line Detection");
w3 = [-1,-1,2;-1,2,-1;2,-1,-1];
Img5 = imfilter(Img1,w3);
subplot(325);
imshow(Img5);
title("+45 Line Detection");
w4 = [2,-1,-1;-1,2,-1;-1,-1,2];
Img5 = imfilter(Img1,w4);
subplot(326);
imshow(Img5);
title("-45 Line Detection");
OUTPUT:
Line Detection
INFERENCE:
Line detection was implemented on the given medical image and corresponding resultant
images were analysed.