0% found this document useful (0 votes)
0 views

Image Processing Lab

The document outlines a lab focused on image processing techniques, including reading and manipulating images in various formats such as RGB, grayscale, and HSV. It details the implementation of filtering, enhancement, and noise removal algorithms using MATLAB code examples. The lab aims to provide hands-on experience in transforming and analyzing digital images for applications in fields like medical imaging and computer vision.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Image Processing Lab

The document outlines a lab focused on image processing techniques, including reading and manipulating images in various formats such as RGB, grayscale, and HSV. It details the implementation of filtering, enhancement, and noise removal algorithms using MATLAB code examples. The lab aims to provide hands-on experience in transforming and analyzing digital images for applications in fields like medical imaging and computer vision.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Lab No : 01

Lab Name : Image Processing Lab including Read Image ,RGB Image, Gray Image, Black & White
Image, Adjusted Image, Historgram of the Image, HSV Image,Hue, Image,Saturation Image and
also adding noises and removing it using algorithm.

Introduction : Image processing involves the analysis and manipulation of digital images to improve their
quality or extract meaningful information. It is widely used in various applications such as medical imaging,
remote sensing, and computer vision. This lab focuses on implementing basic image processing techniques
such as filtering, enhancement, and edge detection to understand how digital images can be transformed
and analyzed using computational methods.

Show The Images :

Code :

Image1=imread("image1.jfif");
imshow(Image1);

Output :

Code :

Image1=imread("image1.jfif");
subplot(2,3,1);
imshow(Image1); title('RGB Image')
imhist(Image1)
whos Image1

grayI=rgb2gray(Image1);
subplot(2,3,2);
imshow(grayI); title('Gray Image')

Black=im2bw(grayI);
subplot(2,3,3);
imshow(Black); title('Black and White Image')
adj=imadjust(grayI);
subplot(2,3,4);
imshow(adj); title('Adjusted Image')

new=Image1;
new=rgb2gray(new);
subplot(2,3,5);
imhist(new); title('Histogram of the Image')

[height, width, colour_planes]=size(Image1);


%colormap('spring')

Output :

Code :
I=imread("image1.jfif");
I1 = I+50;
I2=I-50;
figure(1) ; imshow(I) ;
figure(2) ; imshow(I1);
figure(3) ; imshow(I2);

I=imread("image1.jfif");
I=im2gray(I);
I1_imadjust=imadjust(I)
I1_histeq = histeq(I);
I1_adapthisteq = adapthisteq(I);
montage({I,I1_imadjust,I1_histeq,I1_adapthisteq},"Size",[1 4])
title("Original Image and Enhanced Images using imadjust, histeq, and adapthisteq")

Output :

Figure-1 Figure-2

Figure-3

Code :
I=imread("image1.jfif");
% Convert to HSV color space
subplot(2,3,1);imshow(I)
hsvImage = rgb2hsv(I);

hueImage = hsvImage(:, :, 1);


subplot(2,3,2);imshow(hueImage)
saturationImage = hsvImage(:, :, 2);
subplot(2,3,3);imshow(saturationImage)
valueImage = hsvImage(:, :, 3);
subplot(2,3,4);imshow(valueImage)
someFactor = 1.5; % Whatever you want.
hueImage = hueImage * someFactor;
hueImage = mod(hueImage, 1);
hsvImage = cat(3, hueImage, saturationImage, valueImage);
rgbImage = hsv2rgb(hsvImage);
subplot(2, 3, 5);
imshow(rgbImage);

Output :

Code :

I=imread('coin.jpg');
figure,imshow(I)
J=imnoise(I,"salt & pepper",0.05);
figure, imshow(J)

Avg_filt=filter2(fspecial('average',3),J)/255;
figure, imshow(Avg_filt)
title('Image with salt pepper noise and removed by average filter')

Median_filter=medfilt2(J);
imshowpair(Avg-filt,Median_filter,'montage');
title('Image with salt pepper noise and removed by median filter')

Output :
Figure-1 Figure-2

Code :

I=imread('saturn.png');
J=im2gray(I);
figure,imshow(J);
K=imnoise(I,"gaussian",0,0.0235);
figure,imshow(K(600:1000,1:600));
title('portion of the image with gaussian noise');

L=weiner2(J,[5,5]);
figure, imshow(L(600:1000,1:600));
title('Portion of the image with noise removed by weiner filter');

Output :

Figure-1 Figure-2

You might also like