Professional Documents
Culture Documents
Multiplying the mapping matrix (map2.jpg) with the original image with humans
yields the result (output.jpg)
Figure 4. output.jpg – Final Result
Appendix - Matlab Code
clear all; clc;
imgNoHuman = imread('IMG_2699_Back.bmp');
imgHuman = imread('IMG_2699.bmp');
figure;
subplot(2,2,1); imshow(imgNoHuman)
subplot(2,2,2); imshow(imgHuman)
[x y z] = size(imgNoHuman);
f1 = rgb2gray(imgNoHuman);
f2 = rgb2gray(imgHuman);
imwrite(f1, 'f1.jpg');
imwrite(f2, 'f2.jpg');
g1 = double(f1(:,:,1));
g2 = double(f2(:,:,1));
corr2(g1,g2);
map = zeros(x,y);
cor = zeros(x,y);
% median filter applied to remove salt and pepper noise in map1 array
map2 = medfilt2(map1,[10,10]);
figure;imshow(map2)
imwrite(map2, 'map2.jpg');