0% found this document useful (0 votes)
9 views1 page

Dip 3

The document loads two images, performs linear interpolation between the two images by varying the weighting from 0 to 100%, and plots the histograms of the red, green, and blue channels of one image and the grayscale version of the other.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Dip 3

The document loads two images, performs linear interpolation between the two images by varying the weighting from 0 to 100%, and plots the histograms of the red, green, and blue channels of one image and the grayscale version of the other.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

clear all;

close all;
C = imread("similarity_images3.jpg");
D = imread("similarity_images4.jpg");
L = im2gray(D);

for a = 0:100
Y = (C).*(a/100) + (D).*((100-a)/100);
imshow(Y);

end
for a = 0:100
Y = (C).*((100-a)/100) + (D).*(a/100);
imshow(Y);
end
M = hist1(C(:,:,1));
x = 0:1:255;
figure
imhist(C(:,:,1));
figure
bar(x,M);

N = hist1(C(:,:,2));
figure
imhist(C(:,:,2));
figure
bar(x,N);
K = hist1(C(:,:,3));
figure
imhist(C(:,:,3));
figure
bar(x,K);
gray = hist1(L);
figure
imhist(L);
figure
bar(x,gray);
function X = hist1(k)
X = zeros(1,256);
[m,n] = size(k);
for i = 1:m
for j = 1:n
X(k(i,j)+1) =X(k(i,j)+1)+1;
end
end
end

You might also like