"C:/Users/Naval/Onedrive/Desktop/Anime-Night-Sky-Illustration - JPG" 1 3 1 'Original Image' 1 3 2 'Grey Image' 1 3 3 60 'Grey Shade'
"C:/Users/Naval/Onedrive/Desktop/Anime-Night-Sky-Illustration - JPG" 1 3 1 'Original Image' 1 3 2 'Grey Image' 1 3 3 60 'Grey Shade'
a=imread("C:\Users\naval\OneDrive\Desktop\anime-night-sky-illustration.jpg");
subplot(1, 3, 1);
imshow(a);
title('Original Image');
j=rgb2gray(a);
subplot(1, 3, 2);
imshow(j);
title('Grey Image');
subplot(1, 3, 3);
jcolormap=coolcolormap(60);
imshow(jcolormap);
title('Grey shade');
Output-
EXP-3
a=imread("C:\Users\naval\OneDrive\Desktop\Plumeria -8.jpg");
subplot(1, 3, 1);
imshow(a);
title('First Image');
b=imread("C:\Users\naval\OneDrive\Desktop\56767fb3-5b16-4e60-9083-202890c72a50.jpg");
subplot(1, 3, 2);
imshow(b);
title('Second Image');
c=imadd(a,b);
subplot(1, 3, 3);
imshow(c);
title('Combined Image');
Output-
EXP-3.1
a=imread("C:\Users\naval\OneDrive\Desktop\Plumeria -8.jpg");
imshow(a);
xlabel('First Image');
figure(0);
b=imread("C:\Users\naval\OneDrive\Desktop\56767fb3-5b16-4e60-9083-202890c72a50.jpg");
figure(1);
imshow(b);
xlabel('Second Image');
c=imadd(a,b);
figure(2);
imshow(c);
xlabel('Combined
Images');
subplot(3,2,2);
imshow(b);
subplot(3,2,3);
imshow(a);
Output-
EXP-3.2
a=imread("C:\Users\naval\OneDrive\Desktop\Plumeria -8.jpg");
figure(1);
imshow(a);
xlabel('Original Image');
b=rgb2gray(a);
figure(2);
imshow(b);
c=imadd(b,100);
imshow(c);
xlabel('Final Output');
subplot(3,2,1);
imshow(a);
subplot(3,2,2);
imshow(b);
subplot(3,2,4);
imshow(c);
Output-
EXP3.3
Output-
EXP-5.1
k = imread("C:\\Users\\naval\\OneDrive\\Desktop\\f44b7b24-1549-4c45-966f-
86ad86a68d63.jpg");
k = im2double(k);
w = ones(7, 7) / 49;
y_color = imfilter(k, w);
k_gray = rgb2gray(k);
y_gray = imfilter(k_gray, w);
subplot(2, 2, 1);
imshow(k);
title('Original Color Image', 'FontSize', 5);
subplot(2, 2, 2);
imshow(y_color);
title('Smoothed Color Image', 'FontSize', 5);
subplot(2, 2, 3);
imshow(k_gray);
title('Original Grayscale Image', 'FontSize', 5);
subplot(2, 2, 4);
imshow(y_gray);
title('Smoothed Grayscale Image', 'FontSize', 5);
Output-
EXP5.2
clc;
r = imread("C:\Users\naval\OneDrive\Desktop\f44b7b24-1549-4c45-966f-86ad86a68d63.jpg");
figure;
subplot(1, 2, 1);
imshow(r);
title('Original Color Image');
gray = rgb2gray(r);
a = double(gray);
[m, n] = size(a);
w = [1 1 1; 1 1 1; 1 1 1];
b = zeros(m, n);
for i = 2:m-1
for j = 2:n-1
b(i,j) = w(1)*a(i-1, j+1) + w(2)*a(i,j+1) + w(3)*a(i+1,j+1) ...
+ w(4)*a(i-1,j) + w(5)*a(i,j) + w(6)*a(i+1,j) ...
+ w(7)*a(i-1,j-1) + w(8)*a(i,j-1) + w(9)*a(i+1,j-1);
end
end
c = uint8(b);
subplot(1, 2, 2);
imshow(c);
title('Filtered Image');
Output-
EXP7
a = imread("C:\Users\naval\OneDrive\Desktop\wallpapersden.com_nezuko-demon-slayer-2024-ai-
art_1920x1080.jpg");
figure(1);
imshow(a);
title('Original Image');
b = imcrop(a, [40, 100, 1000, 500]);
figure(2);
imshow(b);
title('Cropped Image');
c = a(1:10:$, 1:10:$, :);
figure(3);
clf;
imshow(c);
title('Resized Image');
d = imrotate(a, 75);
figure(4);
imshow(d);
title('Rotated Image');
figure(5);
imshow(a(:, :, 1));
title('Segmentation of the image');
figure(6);
imshow(b(:, :, 3));
title('Segmentation of the Blue image');
figure(7);
imshow(a(:, :, 2));
title('Segmentation of the Green image');
Output-
EXP-6
clc;
i = imread("C:\Users\naval\OneDrive\Desktop\anime-night-sky-illustration.jpg");
figure();
subplot(2,2,1);
imshow(i);
title("Original Image");
se = ones(5, 5);
for k = 1:3
b(:,:,k) = imerode(i(:,:,k), se);
end
subplot(2,2,2);
imshow(b);
title("Eroded Image");
for k = 1:3
c(:,:,k) = imdilate(i(:,:,k), se);
end
subplot(2,2,3);
imshow(c);
title("Dilated Image");
be = ones(9, 9);
for k = 1:3
s2(:,:,k) = imopen(i(:,:,k), be);
end
subplot(2,2,4);
imshow(s2);
title("Opened Image");
ce = ones(11, 11);
for k = 1:3
s3(:,:,k) = imclose(i(:,:,k), ce);
end
figure();
imshow(s3);
title("Closed Image");
Output-
EXP-4
Output-