Go back to Home
Format of the image tables:
Original image to be low passed, Original image to be high passed, hybrid image
Hybrid images at different scales.
Cat and Dog. Standard Deviation = 7
|
Submarine and Fish. Standard Deviation = 3
|
Plane and Bird. Standard Deviation = 3
|
Bicycle and motorcycle. Standard Deviation = 2
|
However, I felt this effect could be more pronounced by removing color from the motorcycle image. The result is:
|
Marilyn and Einstein. Standard Deviation = 4
|
I wrote a small script to generate hybrid images with different values for standard deviation and organize them into directories. It is based on the proj1.m script. The code is:
%To run this, simply run exec('file1','file2') in the command window. This
%will create a directory in the data folder. It loops from 1 to 10 standard
%deviations.
function exec(img1name, img2name)
image1 = im2single(imread(['../data/' img1name '.bmp']));
image2 = im2single(imread(['../data/' img2name '.bmp']));
mkdir('../data/',[img1name img2name]);
for cutoff_frequency = 1:10
filter = fspecial('Gaussian', cutoff_frequency*4+1, cutoff_frequency);
low_frequencies = my_imfilter(image1, filter);
high_frequencies = image2 - my_imfilter(image2, filter);
hybrid_image = high_frequencies + low_frequencies;
vis = vis_hybrid_image(hybrid_image);
no = int2str(cutoff_frequency);
imwrite(low_frequencies, ['../data/' img1name img2name '/' img1name no 'low_frequencies.jpg'], 'quality', 95);
imwrite(high_frequencies + 0.5, ['../data/' img1name img2name '/' img2name no 'high_frequencies.jpg'], 'quality', 95);
imwrite(hybrid_image, ['../data/' img1name img2name '/' img1name img2name no 'hybrid_image.jpg'], 'quality', 95);
imwrite(vis, ['../data/' img1name img2name '/' img1name img2name no 'hybrid_image_scales.jpg'], 'quality', 95);
end
end
Go back to Home