Lab Report (Debasish)
Lab Report (Debasish)
Lab Name : Image Processing lab including (RGB Image,Gray Image,Black and
White Image, Adjusted Image, Histogram of the Image, HSV image, Adding noise
and removing Image
Output:
img=imread("Tiger.jpg");
subplot(3,2,1);
imshow(img);
title("Rgb Image");
whos img;
grayI=rgb2gray(img);
subplot(3,2,2);
imshow(grayI);
title("Gray Image");
blackI=im2bw(grayI);
subplot(3,2,2);
imshow(blackI);
title("Black & White Image");
adj=imadjust(grayI);
subplot(2,3,5);
imshow(adj);
title("Adjust Image");
new=img;
new=rgb2gray(new);
subplot(2,4,5);
imhist(new);
title("Histogram of the Image")
subplot(2,3,1);imshow(I)
hsvImage = rgb2hsv(I);
rgbImage = hsv2rgb(hsvImage);
subplot(2, 3, 5);
imshow(rgbImage);
Adding Noise and Remove Image Code:
Img = imread("Tiger.jpg"); % Read original image
grayImg = im2gray(Img); % Convert to grayscale
noisyImg = imnoise(Img, "gaussian", 0, 0.0222); % Add Gaussian noise
filteredImg = wiener2(im2gray(noisyImg), [2,2]); % Apply Wiener filter
subplot(1,3,2);
imshow(noisyImg(start_row:end_row, 1:end_col, :));
title("Portion with Gaussian Noise");
subplot(1,3,3);
imshow(filteredImg(start_row:end_row, 1:end_col));
title("Portion after Wiener Filter");
Avg_filt=filter2(fspecial("average",3),J)/255;
figure(3),imshow(Avg_filt)
title("Image with salt pepper noise and removed by average filter");
Median_filter=medfilt2(J);
figure(4),imshowpair(Avg_filt,Median_filter,"montage");
OutPut: